Comparing version 0.9.7 to 0.9.8
{ | ||
"name": "remult", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"description": "remult core lib", | ||
@@ -5,0 +5,0 @@ "homepage": "https://remult.dev/", |
@@ -265,5 +265,6 @@ "use strict"; | ||
sql = _g + (_j.sent()) + ' (' + result + '\r\n)'; | ||
console.log(sql); | ||
//console.log(sql); | ||
return [4 /*yield*/, this.pool.execute(sql)]; | ||
case 13: | ||
//console.log(sql); | ||
_j.sent(); | ||
@@ -315,5 +316,6 @@ _j.label = 14; | ||
sql = _k + _l.apply(void 0, _m.concat([_o.sent()])); | ||
console.log(sql); | ||
//console.log(sql); | ||
return [4 /*yield*/, this.pool.execute(sql)]; | ||
case 8: | ||
//console.log(sql); | ||
_o.sent(); | ||
@@ -371,5 +373,6 @@ _o.label = 9; | ||
sql = _l + _m.apply(void 0, _o.concat([_q.sent()])); | ||
console.log(sql); | ||
//console.log(sql); | ||
return [4 /*yield*/, this.pool.execute(sql)]; | ||
case 9: | ||
//console.log(sql); | ||
_q.sent(); | ||
@@ -376,0 +379,0 @@ _q.label = 10; |
@@ -33,3 +33,7 @@ import { DataProvider } from "./data-interfaces"; | ||
get userChange(): EventDispatcher; | ||
setUser(info: UserInfo): Promise<void>; | ||
setUser(info: UserInfo | { | ||
sub?: string; | ||
name?: string; | ||
permissions?: string[]; | ||
}): Promise<void>; | ||
static apiBaseUrl: string; | ||
@@ -36,0 +40,0 @@ isAllowedForInstance(instance: any, x: AllowedForInstance<any>): boolean; |
@@ -186,10 +186,24 @@ "use strict"; | ||
Remult.prototype.setUser = function (info) { | ||
var _a; | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
var auth; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
this._user = info; | ||
auth = info; | ||
if (auth) { | ||
if (!this._user.id && auth.sub) | ||
this._user.id = auth.sub; | ||
if (!this._user.name && auth.name) | ||
this._user.name = auth.name; | ||
if (!this._user.roles && auth.permissions) { | ||
this._user.roles = auth.permissions; | ||
} | ||
} | ||
if (this._user && !((_a = this._user) === null || _a === void 0 ? void 0 : _a.roles)) | ||
this._user.roles = []; | ||
return [4 /*yield*/, this._userChangeEvent.fire()]; | ||
case 1: | ||
_a.sent(); | ||
_b.sent(); | ||
return [2 /*return*/]; | ||
@@ -228,3 +242,3 @@ } | ||
var e_2, _a; | ||
var _b; | ||
var _b, _c; | ||
if (roles == undefined) | ||
@@ -258,3 +272,3 @@ return undefined; | ||
if (typeof roles === 'string') | ||
if (((_b = this.user.roles) === null || _b === void 0 ? void 0 : _b.indexOf(roles.toString())) >= 0) | ||
if (((_c = (_b = this.user) === null || _b === void 0 ? void 0 : _b.roles) === null || _c === void 0 ? void 0 : _c.indexOf(roles.toString())) >= 0) | ||
return true; | ||
@@ -261,0 +275,0 @@ return false; |
@@ -189,3 +189,3 @@ "use strict"; | ||
var f = _c.value; | ||
if (!f.dbReadOnly && !f.isServerExpression) { | ||
if (!f.dbReadOnly && !f.isServerExpression && !(f == this.entity.idMetadata.field && this.entity.options.dbAutoIncrementId)) { | ||
if (keys.includes(f.key)) { | ||
@@ -192,0 +192,0 @@ newR[f.key] = f.valueConverter.toJson(data[f.key]); |
@@ -438,3 +438,3 @@ "use strict"; | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var r, f, cols, vals, added, resultFilter, _a, _b, x, v, _c, e_5_1, statement, _d, newId_1; | ||
var r, cols, vals, added, resultFilter, _a, _b, x, v, _c, e_5_1, statement, _d, newId_1; | ||
var e_5, _e; | ||
@@ -448,3 +448,2 @@ var _this = this; | ||
r = this.sql.createCommand(); | ||
f = new filter_consumer_bridge_to_sql_request_1.FilterConsumerBridgeToSqlRequest(r); | ||
cols = ''; | ||
@@ -451,0 +450,0 @@ vals = ''; |
@@ -26,2 +26,4 @@ import { ClassType } from "../../classType"; | ||
readonly apiInsertAllowed: boolean; | ||
subscribe(listener: () => void): Unobserve; | ||
readonly isLoading: boolean; | ||
} | ||
@@ -62,3 +64,3 @@ export declare type Fields<entityType> = { | ||
field: FieldMetadata<any>; | ||
getIdFilter(id: any): EntityFilter<entityType>; | ||
getIdFilter(...ids: any[]): EntityFilter<entityType>; | ||
isIdField(col: FieldMetadata): boolean; | ||
@@ -65,0 +67,0 @@ createIdInFilter(items: entityType[]): EntityFilter<entityType>; |
@@ -6,3 +6,3 @@ import { FieldMetadata, FieldOptions, ValueListItem } from "../column-interfaces"; | ||
import { ClassType } from "../../classType"; | ||
import { Remult } from "../context"; | ||
import { Remult, Unobserve } from "../context"; | ||
import { entityEventListener } from "../__EntityValueProvider"; | ||
@@ -57,4 +57,10 @@ import { DataProvider, EntityDataProvider } from "../data-interfaces"; | ||
protected remult: Remult; | ||
error: string; | ||
_error: string; | ||
get error(): string; | ||
set error(val: string); | ||
constructor(columnsInfo: FieldOptions[], instance: T, remult: Remult); | ||
_fire(): void; | ||
private _subscribers; | ||
subscribe(listener: () => void): Unobserve; | ||
isLoading: boolean; | ||
lookups: Map<string, LookupColumn<any>>; | ||
@@ -61,0 +67,0 @@ waitLoad(): Promise<void>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
870859
194
13156
6