Skip to content

Commit

Permalink
Release 2.1.0-rc.14 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan committed Oct 12, 2017
1 parent bee7def commit 997856c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 28 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,15 @@

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-rc.14

- Milestone Details: https://github.com/mean-expert-official/loopback-sdk-builder/milestone/48?closed=1

- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/515
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/514
- Fix: https://github.com/mean-expert-official/loopback-sdk-builder/issues/511
- WIP: https://github.com/mean-expert-official/loopback-sdk-builder/issues/495

## Release 2.1.0-rc.13.5

- Milestone Details: https://github.com/mean-expert-official/loopback-sdk-builder/milestone/47?closed=1
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -101,7 +101,6 @@
"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",
Expand Down
2 changes: 1 addition & 1 deletion tests/fireloop/package.json
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@mean-expert/boot-script": "^1.0.0",
"@mean-expert/loopback-component-realtime": "^1.0.0-rc.9.3",
"@mean-expert/loopback-sdk-builder": "^2.1.0-rc.12.2",
"@mean-expert/loopback-sdk-builder": "file:../..",
"@mean-expert/loopback-stats-mixin": "^1.2.1",
"@mean-expert/model": "^1.0.9",
"@types/mocha": "^2.2.41",
Expand Down
9 changes: 9 additions & 0 deletions tests/ng2web/src/app/shared/sdk/lb.config.ts
Expand Up @@ -26,6 +26,7 @@ export class LoopBackConfig {
private static debug: boolean = true;
private static filterOn: string = 'headers';
private static secure: boolean = false;
private static withCredentials: boolean = false;

public static setApiVersion(version: string = 'api'): void {
LoopBackConfig.version = version;
Expand Down Expand Up @@ -82,4 +83,12 @@ export class LoopBackConfig {
public static isSecureWebSocketsSet(): boolean {
return LoopBackConfig.secure;
}

public static setRequestOptionsCredentials(withCredentials: boolean = false): void {
LoopBackConfig.withCredentials = withCredentials;
}

public static getRequestOptionsCredentials(): boolean {
return LoopBackConfig.withCredentials;
}
}
19 changes: 11 additions & 8 deletions tests/ng2web/src/app/shared/sdk/services/core/auth.service.ts
Expand Up @@ -114,12 +114,14 @@ export class LoopBackAuth {
**/
public save(): boolean {
if (this.token.rememberMe) {
this.persist('id', this.token.id);
this.persist('user', this.token.user);
this.persist('userId', this.token.userId);
this.persist('created', this.token.created);
this.persist('ttl', this.token.ttl);
this.persist('rememberMe', this.token.rememberMe);
let today = new Date();
let expires = new Date(today.getTime() + (this.token.ttl * 1000));
this.persist('id', this.token.id, expires);
this.persist('user', this.token.user, expires);
this.persist('userId', this.token.userId, expires);
this.persist('created', this.token.created, expires);
this.persist('ttl', this.token.ttl, expires);
this.persist('rememberMe', this.token.rememberMe, expires);
return true;
} else {
return false;
Expand Down Expand Up @@ -151,11 +153,12 @@ export class LoopBackAuth {
* @description
* This method saves values to storage
**/
protected persist(prop: string, value: any): void {
protected persist(prop: string, value: any, expires?: Date): void {
try {
this.storage.set(
`${this.prefix}${prop}`,
(typeof value === 'object') ? JSON.stringify(value) : value
(typeof value === 'object') ? JSON.stringify(value) : value,
expires
);
}
catch (err) {
Expand Down
14 changes: 7 additions & 7 deletions tests/ng2web/src/app/shared/sdk/services/core/base.service.ts
Expand Up @@ -99,7 +99,7 @@ export abstract class BaseLoopBackApi {
if (LoopBackConfig.isHeadersFilteringSet()) {
headers.append('filter', JSON.stringify(urlParams.filter));
} else {
filter = `?filter=${ encodeURI(JSON.stringify(urlParams.filter))}`;
filter = `?filter=${ encodeURIComponent(JSON.stringify(urlParams.filter))}`;
}
delete urlParams.filter;
}
Expand All @@ -119,12 +119,12 @@ export abstract class BaseLoopBackApi {
this.searchParams.setJSON(urlParams);
let request: Request = new Request(
new RequestOptions({
headers : headers,
method : method,
url : `${url}${filter}`,
search : Object.keys(urlParams).length > 0
? this.searchParams.getURLSearchParams() : null,
body : body ? JSON.stringify(body) : undefined
headers : headers,
method : method,
url : `${url}${filter}`,
search : Object.keys(urlParams).length > 0 ? this.searchParams.getURLSearchParams() : null,
body : body ? JSON.stringify(body) : undefined,
withCredentials: LoopBackConfig.getRequestOptionsCredentials()
})
);
return this.http.request(request)
Expand Down
20 changes: 12 additions & 8 deletions tests/ng2web/src/app/shared/sdk/services/custom/Storage.ts
Expand Up @@ -102,7 +102,7 @@ export class StorageApi extends BaseLoopBackApi {
*
* - `` – `{}` -
*/
public destroyContainer(container: any = {}, customHeaders?: Function): Observable<any> {
public destroyContainer(container: any, customHeaders?: Function): Observable<any> {
let _method: string = "DELETE";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container";
Expand Down Expand Up @@ -131,7 +131,7 @@ export class StorageApi extends BaseLoopBackApi {
* This usually means the response is a `Storage` object.)
* </em>
*/
public getContainer(container: any = {}, customHeaders?: Function): Observable<any> {
public getContainer(container: any, customHeaders?: Function): Observable<any> {
let _method: string = "GET";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container";
Expand Down Expand Up @@ -160,7 +160,7 @@ export class StorageApi extends BaseLoopBackApi {
* This usually means the response is a `Storage` object.)
* </em>
*/
public getFiles(container: any = {}, customHeaders?: Function): Observable<any> {
public getFiles(container: any, customHeaders?: Function): Observable<any> {
let _method: string = "GET";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container/files";
Expand Down Expand Up @@ -191,7 +191,7 @@ export class StorageApi extends BaseLoopBackApi {
* This usually means the response is a `Storage` object.)
* </em>
*/
public getFile(container: any = {}, file: any = {}, customHeaders?: Function): Observable<any> {
public getFile(container: any, file: any, customHeaders?: Function): Observable<any> {
let _method: string = "GET";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container/files/:file";
Expand Down Expand Up @@ -222,7 +222,7 @@ export class StorageApi extends BaseLoopBackApi {
*
* - `` – `{}` -
*/
public removeFile(container: any = {}, file: any = {}, customHeaders?: Function): Observable<any> {
public removeFile(container: any, file: any, customHeaders?: Function): Observable<any> {
let _method: string = "DELETE";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container/files/:file";
Expand All @@ -241,6 +241,8 @@ export class StorageApi extends BaseLoopBackApi {
* (The remote method definition does not provide any description.)
* </em>
*
* @param {string} container
*
* @param {object} data Request data.
*
* - `req` – `{object}` -
Expand All @@ -255,11 +257,13 @@ export class StorageApi extends BaseLoopBackApi {
*
* - `result` – `{object}` -
*/
public upload(req: any = {}, res: any = {}, customHeaders?: Function): Observable<any> {
public upload(container: any, req: any = {}, res: any = {}, customHeaders?: Function): Observable<any> {
let _method: string = "POST";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container/upload";
let _routeParams: any = {};
let _routeParams: any = {
container: container
};
let _postBody: any = {};
let _urlParams: any = {};
let result = this.request(_method, _url, _routeParams, _urlParams, _postBody, null, customHeaders);
Expand All @@ -285,7 +289,7 @@ export class StorageApi extends BaseLoopBackApi {
*
* This method returns no data.
*/
public download(container: any = {}, file: any = {}, req: any = {}, res: any = {}, customHeaders?: Function): Observable<any> {
public download(container: any, file: any, req: any = {}, res: any = {}, customHeaders?: Function): Observable<any> {
let _method: string = "GET";
let _url: string = LoopBackConfig.getPath() + "/" + LoopBackConfig.getApiVersion() +
"/storages/:container/download/:file";
Expand Down
2 changes: 1 addition & 1 deletion tests/ng2web/src/app/shared/sdk/storage/storage.browser.ts
Expand Up @@ -29,7 +29,7 @@ export class StorageBrowser {
* @description
* The setter will return any type of data persisted in localStorage.
**/
set(key: string, value: any): void {
set(key: string, value: any, expires?: Date): void {
localStorage.setItem(
key,
typeof value === 'object' ? JSON.stringify(value) : value
Expand Down
2 changes: 1 addition & 1 deletion tests/ng2web/src/app/shared/sdk/storage/storage.swaps.ts
Expand Up @@ -23,7 +23,7 @@ export class BaseStorage {
* @description
* The setter will return any type of data persisted in localStorage.
**/
set(key: string, value: any): void {}
set(key: string, value: any, expires?: Date): void {}
/**
* @method remove
* @param {string} key Storage key name
Expand Down
1 change: 0 additions & 1 deletion tests/react-web/package.json
Expand Up @@ -18,7 +18,6 @@
"react-dom": "15.3.2",
"rxjs": "^5.4.3",
"shortid": "2.2.6",

"babel-core": "6.14.0",
"babel-jest": "16.0.0",
"babel-loader": "6.2.5",
Expand Down

0 comments on commit 997856c

Please sign in to comment.