From f2781cfcc829fb94d49c6e555ce7b42d326387e1 Mon Sep 17 00:00:00 2001 From: Chris Tunbridge Date: Tue, 8 Nov 2016 13:24:46 -0700 Subject: [PATCH 1/2] Added support for loopback http context checking The client shouldn't ever know about context, so we'll go ahead and exclude it from the required methods as well as the documentation generation. --- lib/angular2/index.js | 18 ++++++++-- .../shared/services/custom/service.ejs | 7 ++-- tests/angular2/common/models/room.js | 35 +++++++++++++++++-- tests/angular2/loopback/config.json | 2 +- .../src/app/room-service.service.spec.ts | 17 +++++++++ 5 files changed, 71 insertions(+), 8 deletions(-) diff --git a/lib/angular2/index.js b/lib/angular2/index.js index ce16785e..1960b30d 100644 --- a/lib/angular2/index.js +++ b/lib/angular2/index.js @@ -219,7 +219,8 @@ module.exports = function generate(ctx) { buildMethodParams: buildMethodParams, buildServiceImports: buildServiceImports, normalizeMethodName: normalizeMethodName, - buildObservableType: buildObservableType + buildObservableType: buildObservableType, + paramIsContext: paramIsContext } } ]); @@ -464,6 +465,11 @@ module.exports = function generate(ctx) { let availableClasses = relations.map((relationName, index) => model.sharedClass.ctor.relations[relationName].targetClass ); + + params = params.filter(param => { + return !paramIsContext(param) + }); + relations.forEach(relationName => { if (model.sharedClass.ctor.relations[relationName].modelThrough) { let throughName = capitalize( @@ -529,6 +535,14 @@ module.exports = function generate(ctx) { function paramIsFunction(param) { return typeof param.http === 'function' } + /** + * @method paramIsContext + * @description + * Testing if the param is a http.context + */ + function paramIsContext(param) { + return (typeof param.http !== 'undefined' && typeof param.http.source !== 'undefined' && param.http.source === 'context'); + } /** * @method buildPostBody * @description @@ -566,7 +580,7 @@ module.exports = function generate(ctx) { // filter params that should not go over url query string urlParams = urlParams.filter(param => { // Filter out route params and function params - if (paramIsRoute(param) || paramIsFunction(param)) { + if (paramIsRoute(param) || paramIsFunction(param) || paramIsContext(param)) { return false } // Filter out body params diff --git a/lib/angular2/shared/services/custom/service.ejs b/lib/angular2/shared/services/custom/service.ejs index 2c39e6d3..0372ac92 100644 --- a/lib/angular2/shared/services/custom/service.ejs +++ b/lib/angular2/shared/services/custom/service.ejs @@ -218,14 +218,17 @@ action.description = '\n' + } -%> * <%-: action.description | replace:/\n/g, '\n * ' %> <% -var params = action.accepts; +var params = action.accepts.filter(param => { + return !paramIsContext(param); +}); + var postData; if (httpVerb == 'POST' || httpVerb == 'PUT' || httpVerb == 'PATCH') { params = params.filter(function(arg) { return arg.http && (arg.http.source == 'query' || arg.http.source == 'path'); }); postData = action.accepts.filter(function(arg) { - return params.indexOf(arg) == -1; + return params.indexOf(arg) == -1 && !paramIsContext(arg); }); } -%> diff --git a/tests/angular2/common/models/room.js b/tests/angular2/common/models/room.js index cd679c98..d3d30146 100644 --- a/tests/angular2/common/models/room.js +++ b/tests/angular2/common/models/room.js @@ -18,7 +18,7 @@ module.exports = function (Room) { Room.findByRoom = (room, next) => { next(null, room); }; - + Room.remoteMethod( 'findByRoom', { @@ -35,7 +35,7 @@ module.exports = function (Room) { Room.greetPost = (b1, b2, b3, next) => { next(null, `${b1.a}:${b2.b}:${b3.c}`); }; - + Room.remoteMethod( 'greetPost', { @@ -80,6 +80,35 @@ module.exports = function (Room) { http: { path: '/slimshady', verb: 'get' } } ); + + /** + * Mock endpoint thta checks to see if we can read the context and returns a valid result to test it. + * @param room + * @param context + * @param next + */ + Room.findByRoomContext = function(room, context, next){ + var host = (typeof(context.req) !== 'undefined' && typeof(context.req.hostname) !== 'undefined' ? context.req.hostname : false); + + if(host) { + room.name += host; + } else { + room = {id: -1, name: ""}; + } + next(null, room); + }; + + Room.remoteMethod( + 'findByRoomContext', + { + accepts: [ + { arg: 'room', type: 'object', http: { source: 'body' }}, + { arg: 'remoteCtx', description: '**Do not implement in clients**.', type: Object, injectCtx: true, http: { source: 'context' }} + ], + returns: { arg: 'room', type: 'object', root: true }, + http: { path: '/findByRoomContext', verb: 'post' } + } + ); }; -function greet(a, b, c, next) { next(null, `${a}:${b}:${c}`); } \ No newline at end of file +function greet(a, b, c, next) { next(null, `${a}:${b}:${c}`); } diff --git a/tests/angular2/loopback/config.json b/tests/angular2/loopback/config.json index ac5e58c5..25353f74 100644 --- a/tests/angular2/loopback/config.json +++ b/tests/angular2/loopback/config.json @@ -4,7 +4,7 @@ "port": 3000, "remoting": { "context": { - "enableHttpContext": false + "enableHttpContext": true }, "rest": { "normalizeHttpPath": false, diff --git a/tests/angular2/src/app/room-service.service.spec.ts b/tests/angular2/src/app/room-service.service.spec.ts index 4da61393..b87cabff 100644 --- a/tests/angular2/src/app/room-service.service.spec.ts +++ b/tests/angular2/src/app/room-service.service.spec.ts @@ -260,4 +260,21 @@ describe('Service: Room Service', () => { }))))); }) )); + + /** + * This test is to validate that contexts support is working + * i modify the name of the room appending the host to the name if it works + * if it doesn't work i set room.id = -1 and the name to blank + */ + it('should find by mock room to test custom remote method with context enabled', + async(inject([RoomApi], (roomApi: RoomApi) => { + let room = new Room({ id: 42, name: 'my awesome room' }); + return roomApi.findByRoomContext(room) + .subscribe((instance: Room) => { + expect(room.id).toBe(instance.id); + // I append the host onto the instance name so it shouldn't match now + expect(room.name).not.toBe(instance.name); + }); + }) + )); }); From b161ed51f3462d449be069eeb75906818caf7cb2 Mon Sep 17 00:00:00 2001 From: Jonathan Casarrubias Date: Fri, 11 Nov 2016 16:22:54 -0600 Subject: [PATCH 2/2] Release 2.1.0-alpha.17 :rocket: - Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/190 - Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/189 - Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/184 --- CHANGELOG.md | 6 + bin/lb-sdk | 6 +- lib/angular2/index.js | 4 +- lib/angular2/shared/models/flref.ejs | 24 +- .../shared/services/custom/service.ejs | 40 +- package.json | 13 +- tests/angular2/package.json | 2 +- .../src/app/shared/sdk/models/FireLoopRef.ts | 24 +- .../app/shared/sdk/services/custom/Account.ts | 962 +++++------ .../services/custom/ApplicationCredential.ts | 184 +-- .../shared/sdk/services/custom/Category.ts | 320 ++-- .../app/shared/sdk/services/custom/Core.ts | 24 +- .../app/shared/sdk/services/custom/Message.ts | 412 ++--- .../app/shared/sdk/services/custom/Room.ts | 1417 +++++++++-------- .../shared/sdk/services/custom/RoomAccount.ts | 212 +-- .../app/shared/sdk/services/custom/Storage.ts | 116 +- .../app/shared/sdk/services/custom/User.ts | 354 ++-- .../sdk/services/custom/UserCredential.ts | 184 +-- .../sdk/services/custom/UserIdentity.ts | 198 +-- 19 files changed, 2300 insertions(+), 2202 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c4fb70..c536d876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This file is created to keep history of the LoopBack SDK Builder, it does not consider or keeps any history of its parent module `loopback-sdk-angular`. +## Release 2.1.0-beta.17 + +- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/190 +- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/189 +- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/184 + ## Release 2.1.0-beta.16 - Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/185 diff --git a/bin/lb-sdk b/bin/lb-sdk index 654cd777..175112d4 100755 --- a/bin/lb-sdk +++ b/bin/lb-sdk @@ -46,14 +46,16 @@ console.log(chalk.green('* /_/ console.log(chalk.green('* *')); console.log(chalk.green('*========================================================================================*')); console.log(chalk.green('* *')); -console.log(chalk.green('* Developed & Maintained by The MEAN Expert · http://mean.expert *')); -console.log(chalk.green('* http://github.com/mean-expert-official *')); +console.log(chalk.green('* Developed & Maintained by Jonathan Casarrubias *')); +console.log(chalk.green('* MEAN Expert · http://mean.expert · http://github.com/mean-expert-official *')); console.log(chalk.green('* *')); console.log(chalk.green('* CONTRIBUTORS *')); console.log(chalk.green('* João Ribeiro *')); console.log(chalk.green('* Nikolay Matiushenkov *')); console.log(chalk.green('* Sylvain Dumont *')); console.log(chalk.green('* Yonggang Luo *')); +console.log(chalk.green('* Chris Tunbridge *')); +console.log(chalk.green('* Miguel Serrano *')); console.log(chalk.green('* *')); console.log(chalk.green('* ORIGINALLY FORKED FROM *')); console.log(chalk.green('* Miroslav Bajtos\' *')); diff --git a/lib/angular2/index.js b/lib/angular2/index.js index 1960b30d..638c7a1e 100644 --- a/lib/angular2/index.js +++ b/lib/angular2/index.js @@ -587,10 +587,10 @@ module.exports = function generate(ctx) { return (!param.http || param.http.source != 'body') }); if (model.isUser && methodName === 'logout') - output.push(` urlParams.access_token = this.auth.getAccessTokenId();`); + output.push(` _urlParams.access_token = this.auth.getAccessTokenId();`); if (urlParams && urlParams.length > 0) { urlParams.forEach((param, i) => { - output.push(` if (${param.arg}) urlParams.${param.arg} = ${param.arg};`); + output.push(` if (${param.arg}) _urlParams.${param.arg} = ${param.arg};`); }); } return output.join('\n'); diff --git a/lib/angular2/shared/models/flref.ejs b/lib/angular2/shared/models/flref.ejs index 1337d3d1..bcf9bf2a 100644 --- a/lib/angular2/shared/models/flref.ejs +++ b/lib/angular2/shared/models/flref.ejs @@ -7,12 +7,14 @@ export class FireLoopRef { private instance: any; private socket: any; private name: string; + private current: { name: string }; private parent: FireLoopRef; private childs: any = {}; private observables: any = {}; - constructor(name: string, socket: any, parent: FireLoopRef = null) { + constructor(name: string, socket: any, parent: FireLoopRef = null, current = null) { this.name = name; + this.current = current; this.parent = parent; this.socket = socket; return this; @@ -23,11 +25,23 @@ export class FireLoopRef { Math.floor(Math.random() * 100700) * Math.floor(Math.random() * 198500); let subject: Subject = new Subject(); - this.socket.emit(`${this.name}.${event}`, { + let config: {id: any, data: any, current: any, parent: any } = { id: id, data: data, + current: this.current, parent: this.parent && this.parent.instance ? this.parent.instance : null - }); + }; + if (!this.parent || (this.parent && this.current)) { + this.socket.emit(`${this.name}.${event}`, config); + } else { + let interval = setInterval(() => { + if (this.current) { + config.current = this.current; + this.socket.emit(`${this.name}.${event}`, config); + clearInterval(interval); + } + }, 500); + } this.socket.on(`${this.name}.value.result.${id}`, (res: any) => subject.next(res.error ? Observable.throw(res.error) : res) ); @@ -98,6 +112,10 @@ export class FireLoopRef { if (!this.parent) { let childName = `${this.name}.${name}`; if (this.childs[childName]) { return this.childs[childName]; } + this.socket.emit(`${this.name}.relation.request`, { relation: name }); + this.socket.on(`${this.name}.relation.request.result`, (Model: { name: string }) => { + this.childs[childName].current = Model; + }); this.childs[childName] = new FireLoopRef(childName, this.socket, this); return this.childs[childName]; } else { diff --git a/lib/angular2/shared/services/custom/service.ejs b/lib/angular2/shared/services/custom/service.ejs index 0372ac92..e0d73d61 100644 --- a/lib/angular2/shared/services/custom/service.ejs +++ b/lib/angular2/shared/services/custom/service.ejs @@ -35,12 +35,12 @@ export class <%-: modelName %>Api extends BaseLoopBackApi { if (methodName === 'createChangeStream') { -%> public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + <%-: fullPath | q %>; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -62,18 +62,18 @@ export class <%-: modelName %>Api extends BaseLoopBackApi { var routeParams = action.accepts -%> public <%- normalizeMethodName(methodName) %>(<%- buildMethodParams(model, methodName, action.accepts) %>): Observable<<%- buildObservableType(modelName, methodName) %>> { - let method: string = <%-: httpVerb | q %>; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = <%-: httpVerb | q %>; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + <%-: fullPath | q %>; - let routeParams: any = {<%- buildRouteParams(routeParams) %>}; - let postBody: any = {<%- buildPostBody(postData) %>}; - let urlParams: any = {};<%- + let _routeParams: any = {<%- buildRouteParams(routeParams) %>}; + let _postBody: any = {<%- buildPostBody(postData) %>}; + let _urlParams: any = {};<%- buildUrlParams(model, methodName, urlParams) %><% if (model.isUser && methodName === 'logout') { %> this.auth.clear(); <% } -%> - let result = this.request(method, url, routeParams, urlParams, postBody)<% + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody)<% if (model.isUser && methodName === 'login') { %> .map( (response: SDKToken) => { @@ -104,13 +104,13 @@ if (model.isUser && methodName === 'login') { %> -%> public on<%- normalizeMethodName(methodName, true) %>(<%- buildMethodParams(model, methodName, action.accepts, true) %>): Observable<<%- buildObservableType(modelName, methodName) %>> { - let method: string = <%-: httpVerb | q %>; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = <%-: httpVerb | q %>; + let _url: string = "/" + LoopBackConfig.getApiVersion() + <%-: fullPath | q %>; - let routeParams: any = {<%- buildRouteParams(routeParams.filter(function(param) { return param.arg !== 'fk'; })) %>}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {<%- buildRouteParams(routeParams.filter(function(param) { return param.arg !== 'fk'; })) %>}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); <% if (methodName.match(/(^create$|upsert|^findBy|^findOne$)/g)) { %> return result.map((instance: <%- modelName %>) => new <%-: modelName %>(instance));<% @@ -140,15 +140,15 @@ if (methodName.match(/(^create$|upsert|^findBy|^findOne$)/g)) { %> * from the server. */ public getCurrent(): any { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + <%-: model.getPath() | q %> + "/:id"; + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + <%-: model.getPath() | q %> + "/:id"; let id: any = this.auth.getCurrentUserId(); if (id == null) id = '__anonymous__'; - let routeParams: any = { id: id }; - let urlParams: any = {}; - let postBody: any = {}; - return this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = { id: id }; + let _urlParams: any = {}; + let _postBody: any = {}; + return this.request(_method, _url, _routeParams, _urlParams, _postBody); } /** * Get data of the currently logged user that was returned by the last diff --git a/package.json b/package.json index c8979d3a..cc186dca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mean-expert/loopback-sdk-builder", - "version": "2.1.0-beta.16", + "version": "2.1.0-beta.17", "description": "Tool for auto-generating Software Development Kits (SDKs) for LoopBack", "bin": { "lb-sdk": "bin/lb-sdk" @@ -50,6 +50,16 @@ "name": "Yonggang Luo", "email": "luoyonggang@gmail.com", "url": "https://github.com/lygstate" + }, + { + "name": "Chris Tunbridge", + "email": "blasterjr@gmail.com", + "url": "https://github.com/Destreyf" + }, + { + "name": "Miguel Serrano", + "email": "miguelangelserrano4@gmail.com", + "url": "https://github.com/Serranom4" } ], "license": "MIT", @@ -57,6 +67,7 @@ "url": "https://github.com/mean-expert-official/loopback-sdk-builder/issues" }, "dependencies": { + "@mean-expert/loopback-component-realtime": "^1.0.0-beta.8", "chalk": "1.1.3", "ejs": "1.0", "extfs": "0.0.7", diff --git a/tests/angular2/package.json b/tests/angular2/package.json index 216042a5..ac4034ca 100644 --- a/tests/angular2/package.json +++ b/tests/angular2/package.json @@ -22,7 +22,7 @@ "@angular/platform-browser": "2.0.0", "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", - "@mean-expert/loopback-component-realtime": "^1.0.0-beta.5", + "@mean-expert/loopback-component-realtime": "1.0.0-beta.8", "@types/socket.io-client": "^1.4.27", "compression": "^1.0.3", "config-chain": "^1.1.10", diff --git a/tests/angular2/src/app/shared/sdk/models/FireLoopRef.ts b/tests/angular2/src/app/shared/sdk/models/FireLoopRef.ts index 1337d3d1..bcf9bf2a 100644 --- a/tests/angular2/src/app/shared/sdk/models/FireLoopRef.ts +++ b/tests/angular2/src/app/shared/sdk/models/FireLoopRef.ts @@ -7,12 +7,14 @@ export class FireLoopRef { private instance: any; private socket: any; private name: string; + private current: { name: string }; private parent: FireLoopRef; private childs: any = {}; private observables: any = {}; - constructor(name: string, socket: any, parent: FireLoopRef = null) { + constructor(name: string, socket: any, parent: FireLoopRef = null, current = null) { this.name = name; + this.current = current; this.parent = parent; this.socket = socket; return this; @@ -23,11 +25,23 @@ export class FireLoopRef { Math.floor(Math.random() * 100700) * Math.floor(Math.random() * 198500); let subject: Subject = new Subject(); - this.socket.emit(`${this.name}.${event}`, { + let config: {id: any, data: any, current: any, parent: any } = { id: id, data: data, + current: this.current, parent: this.parent && this.parent.instance ? this.parent.instance : null - }); + }; + if (!this.parent || (this.parent && this.current)) { + this.socket.emit(`${this.name}.${event}`, config); + } else { + let interval = setInterval(() => { + if (this.current) { + config.current = this.current; + this.socket.emit(`${this.name}.${event}`, config); + clearInterval(interval); + } + }, 500); + } this.socket.on(`${this.name}.value.result.${id}`, (res: any) => subject.next(res.error ? Observable.throw(res.error) : res) ); @@ -98,6 +112,10 @@ export class FireLoopRef { if (!this.parent) { let childName = `${this.name}.${name}`; if (this.childs[childName]) { return this.childs[childName]; } + this.socket.emit(`${this.name}.relation.request`, { relation: name }); + this.socket.on(`${this.name}.relation.request.result`, (Model: { name: string }) => { + this.childs[childName].current = Model; + }); this.childs[childName] = new FireLoopRef(childName, this.socket, this); return this.childs[childName]; } else { diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Account.ts b/tests/angular2/src/app/shared/sdk/services/custom/Account.ts index d6d25cc0..81c64675 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Account.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Account.ts @@ -49,16 +49,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public findByIdAccessTokens(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -76,29 +76,29 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdAccessTokens(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdAccessTokens(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -124,31 +124,31 @@ export class AccountApi extends BaseLoopBackApi { * */ public updateByIdAccessTokens(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdAccessTokens(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -170,16 +170,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public findByIdRooms(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -197,29 +197,29 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdRooms(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdRooms(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -245,31 +245,31 @@ export class AccountApi extends BaseLoopBackApi { * */ public updateByIdRooms(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdRooms(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -295,31 +295,31 @@ export class AccountApi extends BaseLoopBackApi { * */ public linkRooms(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onLinkRooms(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -338,29 +338,29 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkRooms(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUnlinkRooms(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -382,16 +382,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public existsRooms(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -412,16 +412,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public findByIdAdministrations(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -439,29 +439,29 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdAdministrations(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdAdministrations(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -487,31 +487,31 @@ export class AccountApi extends BaseLoopBackApi { * */ public updateByIdAdministrations(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdAdministrations(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -537,31 +537,31 @@ export class AccountApi extends BaseLoopBackApi { * */ public linkAdministrations(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onLinkAdministrations(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -580,29 +580,29 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkAdministrations(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUnlinkAdministrations(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -624,16 +624,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public existsAdministrations(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -654,16 +654,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public getAccessTokens(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -686,30 +686,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createAccessTokens(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateAccessTokens(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -726,28 +726,28 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public deleteAccessTokens(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteAccessTokens(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -768,16 +768,16 @@ export class AccountApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countAccessTokens(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -798,16 +798,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public getRooms(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -830,30 +830,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createRooms(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateRooms(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -870,28 +870,28 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public deleteRooms(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteRooms(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -912,16 +912,16 @@ export class AccountApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countRooms(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -942,16 +942,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public getAdministrations(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -974,30 +974,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createAdministrations(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateAdministrations(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1014,28 +1014,28 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public deleteAdministrations(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteAdministrations(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1056,16 +1056,16 @@ export class AccountApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countAdministrations(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1086,26 +1086,26 @@ export class AccountApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Account) => new Account(instance)); } public onCreate(): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Account) => new Account(instance)); } @@ -1127,26 +1127,26 @@ export class AccountApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Account) => new Account(instance)); } public onUpsert(): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Account) => new Account(instance)); } @@ -1168,26 +1168,26 @@ export class AccountApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onReplaceOrCreate(): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1211,27 +1211,27 @@ export class AccountApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Account) => new Account(instance)); } public onUpsertWithWhere(where: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Account) => new Account(instance)); } @@ -1250,15 +1250,15 @@ export class AccountApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1279,16 +1279,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Account) => new Account(instance)); } @@ -1311,30 +1311,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onReplaceById(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1354,14 +1354,14 @@ export class AccountApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Account) => new Account(instance)) ); @@ -1382,14 +1382,14 @@ export class AccountApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Account) => new Account(instance)); } @@ -1409,27 +1409,27 @@ export class AccountApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateAll(where: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/update"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1449,28 +1449,28 @@ export class AccountApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1489,14 +1489,14 @@ export class AccountApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1519,30 +1519,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateAttributes(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1563,12 +1563,12 @@ export class AccountApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -1602,16 +1602,16 @@ export class AccountApi extends BaseLoopBackApi { * */ public login(credentials: any, include: any = 'user', rememberMe: boolean = true): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/login"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { credentials: credentials }; - let urlParams: any = {}; - if (include) urlParams.include = include; - let result = this.request(method, url, routeParams, urlParams, postBody) + let _urlParams: any = {}; + if (include) _urlParams.include = include; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody) .map( (response: SDKToken) => { response.rememberMe = rememberMe; @@ -1638,15 +1638,15 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public logout(): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/logout"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - urlParams.access_token = this.auth.getAccessTokenId(); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + _urlParams.access_token = this.auth.getAccessTokenId(); this.auth.clear(); - let result = this.request(method, url, routeParams, urlParams, postBody); + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1666,16 +1666,16 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public confirm(uid: any, token: any, redirect: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/confirm"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (uid) urlParams.uid = uid; - if (token) urlParams.token = token; - if (redirect) urlParams.redirect = redirect; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (uid) _urlParams.uid = uid; + if (token) _urlParams.token = token; + if (redirect) _urlParams.redirect = redirect; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1693,15 +1693,15 @@ export class AccountApi extends BaseLoopBackApi { * This method returns no data. */ public resetPassword(options: any): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/reset"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { options: options }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1724,30 +1724,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createManyAccessTokens(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyAccessTokens(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1771,30 +1771,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createManyRooms(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyRooms(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1818,30 +1818,30 @@ export class AccountApi extends BaseLoopBackApi { * */ public createManyAdministrations(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyAdministrations(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts/:id/administrations"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1863,28 +1863,28 @@ export class AccountApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Account) => new Account(instance)) ); } public onCreateMany(): Observable> { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/Accounts"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result.map((instances: Array) => instances.map((instance: Account) => new Account(instance)) @@ -1905,15 +1905,15 @@ export class AccountApi extends BaseLoopBackApi { * from the server. */ public getCurrent(): any { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts" + "/:id"; + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Accounts" + "/:id"; let id: any = this.auth.getCurrentUserId(); if (id == null) id = '__anonymous__'; - let routeParams: any = { id: id }; - let urlParams: any = {}; - let postBody: any = {}; - return this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = { id: id }; + let _urlParams: any = {}; + let _postBody: any = {}; + return this.request(_method, _url, _routeParams, _urlParams, _postBody); } /** * Get data of the currently logged user that was returned by the last diff --git a/tests/angular2/src/app/shared/sdk/services/custom/ApplicationCredential.ts b/tests/angular2/src/app/shared/sdk/services/custom/ApplicationCredential.ts index 4f0fdaa5..9224deac 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/ApplicationCredential.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/ApplicationCredential.ts @@ -47,15 +47,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: ApplicationCredential) => new ApplicationCredential(instance)); } @@ -76,15 +76,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: ApplicationCredential) => new ApplicationCredential(instance)); } @@ -105,15 +105,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -136,16 +136,16 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: ApplicationCredential) => new ApplicationCredential(instance)); } @@ -163,15 +163,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -192,16 +192,16 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: ApplicationCredential) => new ApplicationCredential(instance)); } @@ -224,17 +224,17 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -253,14 +253,14 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: ApplicationCredential) => new ApplicationCredential(instance)) ); @@ -281,14 +281,14 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: ApplicationCredential) => new ApplicationCredential(instance)); } @@ -308,16 +308,16 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -336,15 +336,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -362,14 +362,14 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -392,17 +392,17 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -422,12 +422,12 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -452,15 +452,15 @@ export class ApplicationCredentialApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/ApplicationCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: ApplicationCredential) => new ApplicationCredential(instance)) ); diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Category.ts b/tests/angular2/src/app/shared/sdk/services/custom/Category.ts index 65e723a5..a6326990 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Category.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Category.ts @@ -48,16 +48,16 @@ export class CategoryApi extends BaseLoopBackApi { * */ public findByIdRooms(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -75,16 +75,16 @@ export class CategoryApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdRooms(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -109,18 +109,18 @@ export class CategoryApi extends BaseLoopBackApi { * */ public updateByIdRooms(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -145,18 +145,18 @@ export class CategoryApi extends BaseLoopBackApi { * */ public linkRooms(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -174,16 +174,16 @@ export class CategoryApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkRooms(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -204,16 +204,16 @@ export class CategoryApi extends BaseLoopBackApi { * */ public existsRooms(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -234,16 +234,16 @@ export class CategoryApi extends BaseLoopBackApi { * */ public getRooms(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -266,17 +266,17 @@ export class CategoryApi extends BaseLoopBackApi { * */ public createRooms(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -292,15 +292,15 @@ export class CategoryApi extends BaseLoopBackApi { * This method returns no data. */ public deleteRooms(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -320,16 +320,16 @@ export class CategoryApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countRooms(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -350,15 +350,15 @@ export class CategoryApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Category) => new Category(instance)); } @@ -379,15 +379,15 @@ export class CategoryApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Category) => new Category(instance)); } @@ -408,15 +408,15 @@ export class CategoryApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -439,16 +439,16 @@ export class CategoryApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Category) => new Category(instance)); } @@ -466,15 +466,15 @@ export class CategoryApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -495,16 +495,16 @@ export class CategoryApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Category) => new Category(instance)); } @@ -527,17 +527,17 @@ export class CategoryApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -556,14 +556,14 @@ export class CategoryApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Category) => new Category(instance)) ); @@ -584,14 +584,14 @@ export class CategoryApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Category) => new Category(instance)); } @@ -611,16 +611,16 @@ export class CategoryApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -639,15 +639,15 @@ export class CategoryApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -665,14 +665,14 @@ export class CategoryApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -695,17 +695,17 @@ export class CategoryApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -725,12 +725,12 @@ export class CategoryApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -757,17 +757,17 @@ export class CategoryApi extends BaseLoopBackApi { * */ public createManyRooms(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories/:id/rooms"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -788,15 +788,15 @@ export class CategoryApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Categories"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Category) => new Category(instance)) ); diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Core.ts b/tests/angular2/src/app/shared/sdk/services/custom/Core.ts index 656e9075..6d115f1d 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Core.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Core.ts @@ -51,17 +51,17 @@ export class CoreApi extends BaseLoopBackApi { * */ public run(path: any = {}, body: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/cores/run/:path"; - let routeParams: any = { + let _routeParams: any = { path: path }; - let postBody: any = { + let _postBody: any = { body: body }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -81,15 +81,15 @@ export class CoreApi extends BaseLoopBackApi { * This method returns no data. */ public invoke(request: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/cores/invoke"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { request: request }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Message.ts b/tests/angular2/src/app/shared/sdk/services/custom/Message.ts index 8fdb721e..fd9f12a3 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Message.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Message.ts @@ -48,16 +48,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public getRoom(id: any, refresh: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/room"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (refresh) urlParams.refresh = refresh; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (refresh) _urlParams.refresh = refresh; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -78,16 +78,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public findByIdReplies(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -105,16 +105,16 @@ export class MessageApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdReplies(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -139,18 +139,18 @@ export class MessageApi extends BaseLoopBackApi { * */ public updateByIdReplies(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -171,16 +171,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public getParent(id: any, refresh: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/parent"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (refresh) urlParams.refresh = refresh; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (refresh) _urlParams.refresh = refresh; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -201,16 +201,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public findByIdLikes(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -228,16 +228,16 @@ export class MessageApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdLikes(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -262,18 +262,18 @@ export class MessageApi extends BaseLoopBackApi { * */ public updateByIdLikes(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -294,16 +294,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public getReplies(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -326,17 +326,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public createReplies(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -352,15 +352,15 @@ export class MessageApi extends BaseLoopBackApi { * This method returns no data. */ public deleteReplies(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -380,16 +380,16 @@ export class MessageApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countReplies(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -410,16 +410,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public getLikes(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -442,17 +442,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public createLikes(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -468,15 +468,15 @@ export class MessageApi extends BaseLoopBackApi { * This method returns no data. */ public deleteLikes(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -496,16 +496,16 @@ export class MessageApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countLikes(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -526,15 +526,15 @@ export class MessageApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Message) => new Message(instance)); } @@ -555,15 +555,15 @@ export class MessageApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Message) => new Message(instance)); } @@ -584,15 +584,15 @@ export class MessageApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -615,16 +615,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Message) => new Message(instance)); } @@ -642,15 +642,15 @@ export class MessageApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -671,16 +671,16 @@ export class MessageApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Message) => new Message(instance)); } @@ -703,17 +703,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -732,14 +732,14 @@ export class MessageApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Message) => new Message(instance)) ); @@ -760,14 +760,14 @@ export class MessageApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Message) => new Message(instance)); } @@ -787,16 +787,16 @@ export class MessageApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -815,15 +815,15 @@ export class MessageApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -841,14 +841,14 @@ export class MessageApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -871,17 +871,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -901,12 +901,12 @@ export class MessageApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -933,17 +933,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public createManyReplies(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/replies"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -966,17 +966,17 @@ export class MessageApi extends BaseLoopBackApi { * */ public createManyLikes(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -997,15 +997,15 @@ export class MessageApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/messages"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Message) => new Message(instance)) ); diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Room.ts b/tests/angular2/src/app/shared/sdk/services/custom/Room.ts index a5fa8ffe..12511952 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Room.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Room.ts @@ -51,16 +51,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByIdMessages(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -78,29 +78,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdMessages(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdMessages(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -126,31 +126,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateByIdMessages(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdMessages(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -172,16 +172,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByIdLikes(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -199,29 +199,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdLikes(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdLikes(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -247,31 +247,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateByIdLikes(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdLikes(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -293,16 +293,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByIdCategories(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -320,29 +320,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdCategories(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdCategories(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -368,31 +368,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateByIdCategories(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdCategories(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -418,31 +418,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public linkCategories(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onLinkCategories(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -461,29 +461,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkCategories(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUnlinkCategories(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -505,16 +505,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public existsCategories(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -535,16 +535,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByIdAccounts(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -562,29 +562,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdAccounts(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdAccounts(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -610,31 +610,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateByIdAccounts(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdAccounts(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -660,31 +660,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public linkAccounts(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onLinkAccounts(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -703,29 +703,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkAccounts(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUnlinkAccounts(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -747,16 +747,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public existsAccounts(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -777,16 +777,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByIdAdmins(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -804,29 +804,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdAdmins(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDestroyByIdAdmins(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -852,31 +852,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateByIdAdmins(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateByIdAdmins(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -902,31 +902,31 @@ export class RoomApi extends BaseLoopBackApi { * */ public linkAdmins(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onLinkAdmins(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -945,29 +945,29 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public unlinkAdmins(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUnlinkAdmins(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -989,16 +989,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public existsAdmins(id: any, fk: any): Observable { - let method: string = "HEAD"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "HEAD"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/rel/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1019,16 +1019,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public getMessages(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1051,30 +1051,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createMessages(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateMessages(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1091,28 +1091,28 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public deleteMessages(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteMessages(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1133,16 +1133,16 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countMessages(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1163,16 +1163,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public getLikes(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1195,30 +1195,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createLikes(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateLikes(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1235,28 +1235,28 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public deleteLikes(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteLikes(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1277,16 +1277,16 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countLikes(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1307,16 +1307,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public getCategories(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1339,30 +1339,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createCategories(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateCategories(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1379,28 +1379,28 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public deleteCategories(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteCategories(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1421,16 +1421,16 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countCategories(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1451,16 +1451,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public getAccounts(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1483,30 +1483,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createAccounts(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateAccounts(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1523,28 +1523,28 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public deleteAccounts(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteAccounts(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1565,16 +1565,16 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countAccounts(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1595,16 +1595,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public getAdmins(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1627,30 +1627,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createAdmins(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateAdmins(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1667,28 +1667,28 @@ export class RoomApi extends BaseLoopBackApi { * This method returns no data. */ public deleteAdmins(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteAdmins(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1709,16 +1709,16 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countAdmins(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1739,26 +1739,26 @@ export class RoomApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } public onCreate(): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Room) => new Room(instance)); } @@ -1780,26 +1780,26 @@ export class RoomApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } public onUpsert(): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Room) => new Room(instance)); } @@ -1821,26 +1821,26 @@ export class RoomApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onReplaceOrCreate(): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -1864,27 +1864,27 @@ export class RoomApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } public onUpsertWithWhere(where: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Room) => new Room(instance)); } @@ -1903,15 +1903,15 @@ export class RoomApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -1932,16 +1932,16 @@ export class RoomApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } @@ -1964,30 +1964,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onReplaceById(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2007,14 +2007,14 @@ export class RoomApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Room) => new Room(instance)) ); @@ -2035,14 +2035,14 @@ export class RoomApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } @@ -2062,27 +2062,27 @@ export class RoomApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateAll(where: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/update"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2102,28 +2102,28 @@ export class RoomApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onDeleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2142,14 +2142,14 @@ export class RoomApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -2172,30 +2172,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onUpdateAttributes(id: any): Observable { - let method: string = "PUT"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2216,12 +2216,12 @@ export class RoomApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -2249,17 +2249,17 @@ export class RoomApi extends BaseLoopBackApi { * - `greeting` – `{string}` - */ public greetRoute(a: any = {}, b: any = {}, c: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/what/:a/:b/:c"; - let routeParams: any = { + let _routeParams: any = { a: a, b: b, c: c }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -2282,26 +2282,26 @@ export class RoomApi extends BaseLoopBackApi { * */ public findByRoom(room: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/findByRoom"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { room: room }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: Room) => new Room(instance)); } public onFindByRoom(room: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/findByRoom"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); return result.map((instance: Room) => new Room(instance)); } @@ -2328,28 +2328,28 @@ export class RoomApi extends BaseLoopBackApi { * - `greeting` – `{object}` - */ public greetPost(a: any = {}, b: any = {}, c: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/who"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { a: a, b: b, c: c }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onGreetPost(a: any = {}, b: any = {}, c: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/who"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2373,26 +2373,26 @@ export class RoomApi extends BaseLoopBackApi { * */ public singleParamPost(param: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/single-param-post"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { param: param }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onSingleParamPost(param: any = {}): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/single-param-post"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2417,19 +2417,62 @@ export class RoomApi extends BaseLoopBackApi { * - `greeting` – `{string}` - */ public greetGet(a: any = {}, b: any = {}, c: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/slimshady"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (a) urlParams.a = a; - if (b) urlParams.b = b; - if (c) urlParams.c = c; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (a) _urlParams.a = a; + if (b) _urlParams.b = b; + if (c) _urlParams.c = c; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } + /** + * + * (The remote method definition does not provide any description.) + * + * + * @param object data Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @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 `Room` object.) + * + */ + public findByRoomContext(room: any = {}): Observable { + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + "/rooms/findByRoomContext"; + let _routeParams: any = {}; + let _postBody: any = { + room: room + }; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); + return result.map((instance: Room) => new Room(instance)); + } + + public onFindByRoomContext(room: any = {}): Observable { + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + + "/rooms/findByRoomContext"; + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); + + return result.map((instance: Room) => new Room(instance)); + } + /** * Creates a new instance in messages of this model. * @@ -2449,30 +2492,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createManyMessages(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyMessages(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/messages"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2496,30 +2539,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createManyLikes(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyLikes(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/likes"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2543,30 +2586,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createManyCategories(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyCategories(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/categories"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2590,30 +2633,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createManyAccounts(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyAccounts(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/accounts"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2637,30 +2680,30 @@ export class RoomApi extends BaseLoopBackApi { * */ public createManyAdmins(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } public onCreateManyAdmins(id: any): Observable { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms/:id/admins"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result; } @@ -2682,28 +2725,28 @@ export class RoomApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: Room) => new Room(instance)) ); } public onCreateMany(): Observable> { - let method: string = "POST"; - let url: string = "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = "/" + LoopBackConfig.getApiVersion() + "/rooms"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody, true); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, true); ; return result.map((instances: Array) => instances.map((instance: Room) => new Room(instance)) diff --git a/tests/angular2/src/app/shared/sdk/services/custom/RoomAccount.ts b/tests/angular2/src/app/shared/sdk/services/custom/RoomAccount.ts index f6cf0f1a..1fc0ab9c 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/RoomAccount.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/RoomAccount.ts @@ -49,16 +49,16 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public getAccount(id: any, refresh: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id/account"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (refresh) urlParams.refresh = refresh; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (refresh) _urlParams.refresh = refresh; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -79,16 +79,16 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public getRoom(id: any, refresh: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id/room"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (refresh) urlParams.refresh = refresh; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (refresh) _urlParams.refresh = refresh; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -109,15 +109,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: RoomAccount) => new RoomAccount(instance)); } @@ -138,15 +138,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: RoomAccount) => new RoomAccount(instance)); } @@ -167,15 +167,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -198,16 +198,16 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: RoomAccount) => new RoomAccount(instance)); } @@ -225,15 +225,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -254,16 +254,16 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: RoomAccount) => new RoomAccount(instance)); } @@ -286,17 +286,17 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -315,14 +315,14 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: RoomAccount) => new RoomAccount(instance)) ); @@ -343,14 +343,14 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: RoomAccount) => new RoomAccount(instance)); } @@ -370,16 +370,16 @@ export class RoomAccountApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -398,15 +398,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -424,14 +424,14 @@ export class RoomAccountApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -454,17 +454,17 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -484,12 +484,12 @@ export class RoomAccountApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -514,15 +514,15 @@ export class RoomAccountApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/room-accounts"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: RoomAccount) => new RoomAccount(instance)) ); diff --git a/tests/angular2/src/app/shared/sdk/services/custom/Storage.ts b/tests/angular2/src/app/shared/sdk/services/custom/Storage.ts index c5e5a157..38a97d57 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/Storage.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/Storage.ts @@ -45,13 +45,13 @@ export class StorageApi extends BaseLoopBackApi { * */ public getContainers(): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -74,15 +74,15 @@ export class StorageApi extends BaseLoopBackApi { * */ public createContainer(options: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { options: options }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -102,15 +102,15 @@ export class StorageApi extends BaseLoopBackApi { * - `` – `{}` - */ public destroyContainer(container: any = {}): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container"; - let routeParams: any = { + let _routeParams: any = { container: container }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -131,15 +131,15 @@ export class StorageApi extends BaseLoopBackApi { * */ public getContainer(container: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container"; - let routeParams: any = { + let _routeParams: any = { container: container }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -160,15 +160,15 @@ export class StorageApi extends BaseLoopBackApi { * */ public getFiles(container: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container/files"; - let routeParams: any = { + let _routeParams: any = { container: container }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -191,16 +191,16 @@ export class StorageApi extends BaseLoopBackApi { * */ public getFile(container: any = {}, file: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container/files/:file"; - let routeParams: any = { + let _routeParams: any = { container: container, file: file }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -222,16 +222,16 @@ export class StorageApi extends BaseLoopBackApi { * - `` – `{}` - */ public removeFile(container: any = {}, file: any = {}): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container/files/:file"; - let routeParams: any = { + let _routeParams: any = { container: container, file: file }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -255,15 +255,15 @@ export class StorageApi extends BaseLoopBackApi { * - `result` – `{object}` - */ public upload(req: any = {}, res: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container/upload"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (req) urlParams.req = req; - if (res) urlParams.res = res; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (req) _urlParams.req = req; + if (res) _urlParams.res = res; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -287,18 +287,18 @@ export class StorageApi extends BaseLoopBackApi { * This method returns no data. */ public download(container: any = {}, file: any = {}, req: any = {}, res: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/storages/:container/download/:file"; - let routeParams: any = { + let _routeParams: any = { container: container, file: file }; - let postBody: any = {}; - let urlParams: any = {}; - if (req) urlParams.req = req; - if (res) urlParams.res = res; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (req) _urlParams.req = req; + if (res) _urlParams.res = res; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } diff --git a/tests/angular2/src/app/shared/sdk/services/custom/User.ts b/tests/angular2/src/app/shared/sdk/services/custom/User.ts index fa692cf3..dd0de1e5 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/User.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/User.ts @@ -47,16 +47,16 @@ export class UserApi extends BaseLoopBackApi { * */ public findByIdAccessTokens(id: any, fk: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -74,16 +74,16 @@ export class UserApi extends BaseLoopBackApi { * This method returns no data. */ public destroyByIdAccessTokens(id: any, fk: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -108,18 +108,18 @@ export class UserApi extends BaseLoopBackApi { * */ public updateByIdAccessTokens(id: any, fk: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens/:fk"; - let routeParams: any = { + let _routeParams: any = { id: id, fk: fk }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -140,16 +140,16 @@ export class UserApi extends BaseLoopBackApi { * */ public getAccessTokens(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -172,17 +172,17 @@ export class UserApi extends BaseLoopBackApi { * */ public createAccessTokens(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -198,15 +198,15 @@ export class UserApi extends BaseLoopBackApi { * This method returns no data. */ public deleteAccessTokens(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -226,16 +226,16 @@ export class UserApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public countAccessTokens(id: any, where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens/count"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -256,15 +256,15 @@ export class UserApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: User) => new User(instance)); } @@ -285,15 +285,15 @@ export class UserApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: User) => new User(instance)); } @@ -314,15 +314,15 @@ export class UserApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -345,16 +345,16 @@ export class UserApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: User) => new User(instance)); } @@ -372,15 +372,15 @@ export class UserApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -401,16 +401,16 @@ export class UserApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: User) => new User(instance)); } @@ -433,17 +433,17 @@ export class UserApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -462,14 +462,14 @@ export class UserApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: User) => new User(instance)) ); @@ -490,14 +490,14 @@ export class UserApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: User) => new User(instance)); } @@ -517,16 +517,16 @@ export class UserApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -545,15 +545,15 @@ export class UserApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -571,14 +571,14 @@ export class UserApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -601,17 +601,17 @@ export class UserApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -631,12 +631,12 @@ export class UserApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -670,16 +670,16 @@ export class UserApi extends BaseLoopBackApi { * */ public login(credentials: any, include: any = 'user', rememberMe: boolean = true): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/login"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { credentials: credentials }; - let urlParams: any = {}; - if (include) urlParams.include = include; - let result = this.request(method, url, routeParams, urlParams, postBody) + let _urlParams: any = {}; + if (include) _urlParams.include = include; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody) .map( (response: SDKToken) => { response.rememberMe = rememberMe; @@ -706,15 +706,15 @@ export class UserApi extends BaseLoopBackApi { * This method returns no data. */ public logout(): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/logout"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - urlParams.access_token = this.auth.getAccessTokenId(); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + _urlParams.access_token = this.auth.getAccessTokenId(); this.auth.clear(); - let result = this.request(method, url, routeParams, urlParams, postBody); + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -734,16 +734,16 @@ export class UserApi extends BaseLoopBackApi { * This method returns no data. */ public confirm(uid: any, token: any, redirect: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/confirm"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (uid) urlParams.uid = uid; - if (token) urlParams.token = token; - if (redirect) urlParams.redirect = redirect; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (uid) _urlParams.uid = uid; + if (token) _urlParams.token = token; + if (redirect) _urlParams.redirect = redirect; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -761,15 +761,15 @@ export class UserApi extends BaseLoopBackApi { * This method returns no data. */ public resetPassword(options: any): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/reset"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { options: options }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -792,17 +792,17 @@ export class UserApi extends BaseLoopBackApi { * */ public createManyAccessTokens(id: any, data: Array = []): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users/:id/accessTokens"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -823,15 +823,15 @@ export class UserApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: User) => new User(instance)) ); @@ -851,15 +851,15 @@ export class UserApi extends BaseLoopBackApi { * from the server. */ public getCurrent(): any { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users" + "/:id"; + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/Users" + "/:id"; let id: any = this.auth.getCurrentUserId(); if (id == null) id = '__anonymous__'; - let routeParams: any = { id: id }; - let urlParams: any = {}; - let postBody: any = {}; - return this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = { id: id }; + let _urlParams: any = {}; + let _postBody: any = {}; + return this.request(_method, _url, _routeParams, _urlParams, _postBody); } /** * Get data of the currently logged user that was returned by the last diff --git a/tests/angular2/src/app/shared/sdk/services/custom/UserCredential.ts b/tests/angular2/src/app/shared/sdk/services/custom/UserCredential.ts index aef30c72..f5fd2fbd 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/UserCredential.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/UserCredential.ts @@ -47,15 +47,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserCredential) => new UserCredential(instance)); } @@ -76,15 +76,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserCredential) => new UserCredential(instance)); } @@ -105,15 +105,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -136,16 +136,16 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserCredential) => new UserCredential(instance)); } @@ -163,15 +163,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -192,16 +192,16 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserCredential) => new UserCredential(instance)); } @@ -224,17 +224,17 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -253,14 +253,14 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: UserCredential) => new UserCredential(instance)) ); @@ -281,14 +281,14 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserCredential) => new UserCredential(instance)); } @@ -308,16 +308,16 @@ export class UserCredentialApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -336,15 +336,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -362,14 +362,14 @@ export class UserCredentialApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -392,17 +392,17 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -422,12 +422,12 @@ export class UserCredentialApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -452,15 +452,15 @@ export class UserCredentialApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserCredentials"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: UserCredential) => new UserCredential(instance)) ); diff --git a/tests/angular2/src/app/shared/sdk/services/custom/UserIdentity.ts b/tests/angular2/src/app/shared/sdk/services/custom/UserIdentity.ts index 217d6728..9821b4ff 100644 --- a/tests/angular2/src/app/shared/sdk/services/custom/UserIdentity.ts +++ b/tests/angular2/src/app/shared/sdk/services/custom/UserIdentity.ts @@ -48,16 +48,16 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public getUser(id: any, refresh: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id/user"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (refresh) urlParams.refresh = refresh; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (refresh) _urlParams.refresh = refresh; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -78,15 +78,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public create(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserIdentity) => new UserIdentity(instance)); } @@ -107,15 +107,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public upsert(data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserIdentity) => new UserIdentity(instance)); } @@ -136,15 +136,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public replaceOrCreate(data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/replaceOrCreate"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -167,16 +167,16 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public upsertWithWhere(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/upsertWithWhere"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserIdentity) => new UserIdentity(instance)); } @@ -194,15 +194,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * - `exists` – `{boolean}` - */ public exists(id: any): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id/exists"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -223,16 +223,16 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public findById(id: any, filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserIdentity) => new UserIdentity(instance)); } @@ -255,17 +255,17 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public replaceById(id: any, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id/replace"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -284,14 +284,14 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public find(filter: LoopBackFilter = {}): Observable> { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: UserIdentity) => new UserIdentity(instance)) ); @@ -312,14 +312,14 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public findOne(filter: LoopBackFilter = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/findOne"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (filter) urlParams.filter = filter; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (filter) _urlParams.filter = filter; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instance: UserIdentity) => new UserIdentity(instance)); } @@ -339,16 +339,16 @@ export class UserIdentityApi extends BaseLoopBackApi { * The number of instances updated */ public updateAll(where: any = {}, data: any = {}): Observable { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/update"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -367,15 +367,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public deleteById(id: any): Observable { - let method: string = "DELETE"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "DELETE"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = {}; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _postBody: any = {}; + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -393,14 +393,14 @@ export class UserIdentityApi extends BaseLoopBackApi { * - `count` – `{number}` - */ public count(where: any = {}): Observable { - let method: string = "GET"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "GET"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/count"; - let routeParams: any = {}; - let postBody: any = {}; - let urlParams: any = {}; - if (where) urlParams.where = where; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _routeParams: any = {}; + let _postBody: any = {}; + let _urlParams: any = {}; + if (where) _urlParams.where = where; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -423,17 +423,17 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public updateAttributes(id: any, data: any = {}): Observable { - let method: string = "PUT"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "PUT"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/:id"; - let routeParams: any = { + let _routeParams: any = { id: id }; - let postBody: any = { + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result; } @@ -453,12 +453,12 @@ export class UserIdentityApi extends BaseLoopBackApi { * - `changes` – `{ReadableStream}` - */ public createChangeStream(): Observable { - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities/change-stream"; let subject = new Subject(); if (typeof EventSource !== 'undefined') { let emit = (msg: any) => subject.next(JSON.parse(msg.data)); - var source = new EventSource(url); + var source = new EventSource(_url); source.addEventListener('data', emit); source.onerror = emit; } else { @@ -483,15 +483,15 @@ export class UserIdentityApi extends BaseLoopBackApi { * */ public createMany(data: Array = []): Observable> { - let method: string = "POST"; - let url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + + let _method: string = "POST"; + let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() + "/UserIdentities"; - let routeParams: any = {}; - let postBody: any = { + let _routeParams: any = {}; + let _postBody: any = { data: data }; - let urlParams: any = {}; - let result = this.request(method, url, routeParams, urlParams, postBody); + let _urlParams: any = {}; + let result = this.request(_method, _url, _routeParams, _urlParams, _postBody); return result.map((instances: Array) => instances.map((instance: UserIdentity) => new UserIdentity(instance)) );