Skip to content

Commit

Permalink
Merge pull request #234 from mean-expert-official/development
Browse files Browse the repository at this point in the history
Release 2.1.0-rc.2
  • Loading branch information
jonathan-casarrubias authored Dec 1, 2016
2 parents e8f2817 + e127017 commit 811bded
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 39 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

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-rc1
## Release 2.1.0-rc.2

- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/233

## Release 2.1.0-rc.1

- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/232
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/231
Expand All @@ -22,6 +26,7 @@ This file is created to keep history of the LoopBack SDK Builder, it does not co
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/204
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/203
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/202
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/211

## Release 2.1.0-beta.17

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All Rights Reserved

MEAN Expert, LoopBack SDK Builder, SDK Builder Mascot and The FireLoop.io name and Logos are protected by copyright and distributed under licenses restricting copying, distribution and decompilation.

#Software MTI License
#Software MIT License
Copyright (c) 2016 MEAN Expert - Jonathan Casarrubias <@johncasarrubias>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand Down
4 changes: 2 additions & 2 deletions lib/angular2/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module Angular 2 Generator for loopback-sdk-builder
* @author Jonathan Casarrubias <@johncasarrubias> <github:jonathan-casarrubias>
* @license MTI
* @license MIT
* @description
* Defines a SDK Schema and builds according configuration
*/
Expand Down Expand Up @@ -758,7 +758,7 @@ module.exports = function generate(ctx) {
}
/**
* @author João Ribeiro <jonnybgod@gmail.com, http://jonnybgod.ghost.io>,
* @license MTI
* @license MIT
* @method buildPropertyType
* @description
* Define which properties should be passed as route params
Expand Down
16 changes: 4 additions & 12 deletions lib/angular2/shared/models/flref.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LoopBackFilter, StatFilter } from './index';
**/
export class FireLoopRef<T> {
// Reference ID
private id: number = Date.now() + this.buildId();
private id: number = this.buildId();
// Model Instance (For child references, empty on root references)
private instance: any;
// Model Childs
Expand Down Expand Up @@ -97,7 +97,6 @@ export class FireLoopRef<T> {
} else {
return this.broadcasts(event, request);
}

}
/**
* @method stats
Expand All @@ -108,14 +107,7 @@ export class FireLoopRef<T> {
* TIP: You can improve performance by adding memcached to LoopBack models.
**/
public stats(filter?: StatFilter): Observable<T | T[]> {
let event = `${this.model.getModelName()}.stats`;
let src_pull: Observable<T> = this.pull(event, filter);
// Listen for broadcast announces
let src_request: Observable<T> = Observable.fromEvent<T>(this.socket, `${event}.broadcast.announce`);
src_request.subscribe((res: T) => this.socket.emit(`${event}.broadcast.request`, filter));
// Listen for broadcasted results
let src_broadcast: Observable<T> = Observable.fromEvent<T>(this.socket, `${event}.broadcast`);
return Observable.merge(src_pull, src_broadcast);
return this.on('stats', filter);
}
/**
* @method make
Expand Down Expand Up @@ -167,7 +159,7 @@ export class FireLoopRef<T> {
let that: FireLoopRef<T> = this;
let nowEvent: any = `${event}.pull.requested.${ this.id }`;
this.socket.emit(`${event}.pull.request.${ this.id }`, request);
function pullNow(data) {
function pullNow(data: any) {
that.socket.removeListener(nowEvent, pullNow);
sbj.next(data);
};
Expand Down Expand Up @@ -221,7 +213,7 @@ export class FireLoopRef<T> {
* multiple references for the same model or relationships.
**/
private buildId(): number {
return Math.floor(Math.random() * 100800) *
return Date.now() + Math.floor(Math.random() * 100800) *
Math.floor(Math.random() * 100700) *
Math.floor(Math.random() * 198500);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/angular2/shared/services/core/auth.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SDKToken, AccessToken } from '../../models/BaseModels';
/**
* @module LoopBackAuth
* @author Jonathan Casarrubias <@johncasarrubias> <github:jonathan-casarrubias>
* @license MTI
* @license MIT
* @description
* Provides with a LoopBack compatible authentication mechanism.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/angular2/shared/services/core/base.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare var EventSource: any;
* @module BaseLoopBackApi
* @author Nikolay Matiushenkov <https://github.com/mnvx>
* @contributor Jonathan Casarrubias <@johncasarrubias> <github:jonathan-casarrubias>
* @license MTI
* @license MIT
* @description
* Abstract class that will be implemented in every custom service automatically built
* by the sdk builder.
Expand Down
2 changes: 1 addition & 1 deletion lib/angular2/shared/services/core/logger.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LoopBackConfig } from '../../lb.config';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module LoggerService
* @license MTI
* @license MIT
* @description
* Console Log wrapper that can be disabled in production mode
**/
Expand Down
2 changes: 1 addition & 1 deletion lib/angular2/shared/services/core/search.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { URLSearchParams } from '@angular/http';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module JSONSearchParams
* @license MTI
* @license MIT
* @description
* JSON Parser and Wrapper for the Angular2 URLSearchParams
* This module correctly encodes a json object into a query string and then creates
Expand Down
2 changes: 1 addition & 1 deletion lib/angular2/shared/sockets/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccessToken } from '../models';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module SocketConnections
* @license MTI
* @license MIT
* @description
* This module handle socket connections and return singleton instances for each
* connection, it will use the SDK Socket Driver Available currently supporting
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mean-expert/loopback-sdk-builder",
"version": "2.1.0-rc.1",
"version": "2.1.0-rc.2",
"description": "Tool for auto-generating Software Development Kits (SDKs) for LoopBack",
"bin": {
"lb-sdk": "bin/lb-sdk"
Expand Down
16 changes: 4 additions & 12 deletions tests/angular2/src/app/shared/sdk/models/FireLoopRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LoopBackFilter, StatFilter } from './index';
**/
export class FireLoopRef<T> {
// Reference ID
private id: number = Date.now() + this.buildId();
private id: number = this.buildId();
// Model Instance (For child references, empty on root references)
private instance: any;
// Model Childs
Expand Down Expand Up @@ -97,7 +97,6 @@ export class FireLoopRef<T> {
} else {
return this.broadcasts(event, request);
}

}
/**
* @method stats
Expand All @@ -108,14 +107,7 @@ export class FireLoopRef<T> {
* TIP: You can improve performance by adding memcached to LoopBack models.
**/
public stats(filter?: StatFilter): Observable<T | T[]> {
let event = `${this.model.getModelName()}.stats`;
let src_pull: Observable<T> = this.pull(event, filter);
// Listen for broadcast announces
let src_request: Observable<T> = Observable.fromEvent<T>(this.socket, `${event}.broadcast.announce`);
src_request.subscribe((res: T) => this.socket.emit(`${event}.broadcast.request`, filter));
// Listen for broadcasted results
let src_broadcast: Observable<T> = Observable.fromEvent<T>(this.socket, `${event}.broadcast`);
return Observable.merge(src_pull, src_broadcast);
return this.on('stats', filter);
}
/**
* @method make
Expand Down Expand Up @@ -167,7 +159,7 @@ export class FireLoopRef<T> {
let that: FireLoopRef<T> = this;
let nowEvent: any = `${event}.pull.requested.${ this.id }`;
this.socket.emit(`${event}.pull.request.${ this.id }`, request);
function pullNow(data) {
function pullNow(data: any) {
that.socket.removeListener(nowEvent, pullNow);
sbj.next(data);
};
Expand Down Expand Up @@ -221,7 +213,7 @@ export class FireLoopRef<T> {
* multiple references for the same model or relationships.
**/
private buildId(): number {
return Math.floor(Math.random() * 100800) *
return Date.now() + Math.floor(Math.random() * 100800) *
Math.floor(Math.random() * 100700) *
Math.floor(Math.random() * 198500);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SDKToken, AccessToken } from '../../models/BaseModels';
/**
* @module LoopBackAuth
* @author Jonathan Casarrubias <@johncasarrubias> <github:jonathan-casarrubias>
* @license MTI
* @license MIT
* @description
* Provides with a LoopBack compatible authentication mechanism.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare var EventSource: any;
* @module BaseLoopBackApi
* @author Nikolay Matiushenkov <https://github.com/mnvx>
* @contributor Jonathan Casarrubias <@johncasarrubias> <github:jonathan-casarrubias>
* @license MTI
* @license MIT
* @description
* Abstract class that will be implemented in every custom service automatically built
* by the sdk builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { URLSearchParams } from '@angular/http';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module JSONSearchParams
* @license MTI
* @license MIT
* @description
* JSON Parser and Wrapper for the Angular2 URLSearchParams
* This module correctly encodes a json object into a query string and then creates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LoopBackConfig } from '../../lb.config';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module LoggerService
* @license MTI
* @license MIT
* @description
* Console Log wrapper that can be disabled in production mode
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccessToken } from '../models';
/**
* @author Jonathan Casarrubias <twitter:@johncasarrubias> <github:@johncasarrubias>
* @module SocketConnections
* @license MTI
* @license MIT
* @description
* This module handle socket connections and return singleton instances for each
* connection, it will use the SDK Socket Driver Available currently supporting
Expand Down

0 comments on commit 811bded

Please sign in to comment.