remult 0.18.1-exp.40 → 0.18.1-exp.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +1 -1
- package/esm/src/__EntityValueProvider.d.ts +1 -0
- package/esm/src/context.d.ts +2 -3
- package/esm/src/remult3/RepositoryImplementation.d.ts +5 -4
- package/esm/src/remult3/RepositoryImplementation.js +5 -0
- package/esm/src/remult3/remult3.d.ts +2 -3
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/__EntityValueProvider.d.ts +1 -0
- package/src/context.d.ts +2 -3
- package/src/remult3/RepositoryImplementation.d.ts +5 -4
- package/src/remult3/RepositoryImplementation.js +122 -93
- package/src/remult3/remult3.d.ts +2 -3
package/esm/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { SqlDatabase, } from './src/data-providers/sql-database';
|
|
|
14
14
|
export { CustomSqlFilterObject, CustomSqlFilterBuilder, dbNamesOf } from './src/filter/filter-consumer-bridge-to-sql-request';
|
|
15
15
|
export { JsonDataProvider, JsonEntityStorage } from './src/data-providers/json-data-provider';
|
|
16
16
|
export { Controller, BackendMethodOptions, BackendMethod, ProgressListener } from './src/server-action';
|
|
17
|
-
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource,
|
|
17
|
+
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource, UserInfo } from './src/context';
|
|
18
18
|
export { ExternalHttpProvider } from './src/buildRestDataProvider';
|
|
19
19
|
export { IdEntity } from './src/id-entity';
|
|
20
20
|
export { SortSegment, Sort } from './src/sort';
|
package/esm/src/context.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { EntityMetadata, EntityRef, FindOptions, Repository } from "./remult3";
|
|
|
3
3
|
import { ClassType } from "../classType";
|
|
4
4
|
import type { SubscriptionServer } from "./live-query/SubscriptionServer";
|
|
5
5
|
import { ExternalHttpProvider } from "./buildRestDataProvider";
|
|
6
|
-
import { SubscriptionClient } from "./live-query/SubscriptionChannel";
|
|
6
|
+
import { SubscriptionClient, Unsubscribe } from "./live-query/SubscriptionChannel";
|
|
7
7
|
export declare function isBackend(): boolean;
|
|
8
8
|
export declare class Remult {
|
|
9
9
|
/**Return's a `Repository` of the specific entity type
|
|
@@ -102,9 +102,8 @@ export declare const queryConfig: {
|
|
|
102
102
|
defaultPageSize: number;
|
|
103
103
|
};
|
|
104
104
|
export interface EventDispatcher {
|
|
105
|
-
observe(what: () => any | Promise<any>): Promise<
|
|
105
|
+
observe(what: () => any | Promise<any>): Promise<Unsubscribe>;
|
|
106
106
|
}
|
|
107
|
-
export declare type Unobserve = () => void;
|
|
108
107
|
export declare class EventSource {
|
|
109
108
|
listeners: (() => {})[];
|
|
110
109
|
fire(): Promise<void>;
|
|
@@ -3,10 +3,11 @@ import { EntityOptions } from "../entity";
|
|
|
3
3
|
import { LookupColumn } from '../column';
|
|
4
4
|
import { EntityMetadata, FieldRef, FieldsRef, EntityFilter, FindOptions, Repository, EntityRef, QueryOptions, QueryResult, EntityOrderBy, FieldsMetadata, IdMetadata, FindFirstOptionsBase, FindFirstOptions, OmitEB, Subscribable, ControllerRef } from "./remult3";
|
|
5
5
|
import { ClassType } from "../../classType";
|
|
6
|
-
import { Remult
|
|
6
|
+
import { Remult } from "../context";
|
|
7
7
|
import { entityEventListener } from "../__EntityValueProvider";
|
|
8
8
|
import { DataProvider, EntityDataProvider, EntityDataProviderFindOptions } from "../data-interfaces";
|
|
9
9
|
import { RefSubscriber } from ".";
|
|
10
|
+
import { Unsubscribe } from "../live-query/SubscriptionChannel";
|
|
10
11
|
export declare class RepositoryImplementation<entityType> implements Repository<entityType> {
|
|
11
12
|
private entity;
|
|
12
13
|
remult: Remult;
|
|
@@ -72,7 +73,7 @@ declare abstract class rowHelperBase<T> {
|
|
|
72
73
|
set error(val: string);
|
|
73
74
|
constructor(columnsInfo: FieldOptions[], instance: T, remult: Remult);
|
|
74
75
|
_subscribers: SubscribableImp;
|
|
75
|
-
subscribe(listener: RefSubscriber):
|
|
76
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
76
77
|
_isLoading: boolean;
|
|
77
78
|
initSubscribers(): void;
|
|
78
79
|
get isLoading(): boolean;
|
|
@@ -148,7 +149,7 @@ export declare class FieldRefImplementation<entityType, valueType> implements Fi
|
|
|
148
149
|
private rowBase;
|
|
149
150
|
constructor(settings: FieldOptions, metadata: FieldMetadata, container: any, helper: EntityRef<entityType>, rowBase: rowHelperBase<entityType>);
|
|
150
151
|
_subscribers: SubscribableImp;
|
|
151
|
-
subscribe(listener: RefSubscriber):
|
|
152
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
152
153
|
valueIsNull(): boolean;
|
|
153
154
|
originalValueIsNull(): boolean;
|
|
154
155
|
load(): Promise<valueType>;
|
|
@@ -325,7 +326,7 @@ declare class SubscribableImp implements Subscribable {
|
|
|
325
326
|
subscribe(listener: (() => void) | {
|
|
326
327
|
reportChanged: () => void;
|
|
327
328
|
reportObserved: () => void;
|
|
328
|
-
}):
|
|
329
|
+
}): Unsubscribe;
|
|
329
330
|
}
|
|
330
331
|
export declare function getEntityMetadata<entityType>(entity: EntityMetadataOverloads<entityType>): EntityMetadata<entityType>;
|
|
331
332
|
export declare function getRepository<entityType>(entity: RepositoryOverloads<entityType>): Repository<entityType>;
|
|
@@ -835,6 +835,7 @@ export class rowHelperImplementation extends rowHelperBase {
|
|
|
835
835
|
if (this.info.idMetadata.field instanceof CompoundIdField)
|
|
836
836
|
delete (d.id);
|
|
837
837
|
let updatedRow;
|
|
838
|
+
let isNew = this.isNew();
|
|
838
839
|
try {
|
|
839
840
|
this._subscribers?.reportChanged();
|
|
840
841
|
if (this.isNew()) {
|
|
@@ -864,6 +865,10 @@ export class rowHelperImplementation extends rowHelperBase {
|
|
|
864
865
|
await this.loadDataFrom(updatedRow);
|
|
865
866
|
if (this.info.entityInfo.saved)
|
|
866
867
|
await this.info.entityInfo.saved(this.instance);
|
|
868
|
+
if (this.repository.listeners)
|
|
869
|
+
for (const listener of this.repository.listeners.filter(x => x.saved)) {
|
|
870
|
+
await listener.saved(this.instance, isNew);
|
|
871
|
+
}
|
|
867
872
|
await this.repository.remult.liveQueryPublisher.itemChanged(this.repository.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
868
873
|
this.saveOriginalData();
|
|
869
874
|
this._isNew = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ClassType } from "../../classType";
|
|
2
2
|
import { FieldMetadata } from "../column-interfaces";
|
|
3
|
-
import { Unobserve } from "../context";
|
|
4
3
|
import { LiveQueryChange, SubscriptionListener, Unsubscribe } from "../live-query/SubscriptionChannel";
|
|
5
4
|
import { EntityOptions } from "../entity";
|
|
6
5
|
import { SortSegment } from "../sort";
|
|
@@ -40,7 +39,7 @@ export interface RefSubscriberBase {
|
|
|
40
39
|
}
|
|
41
40
|
export declare type RefSubscriber = (() => void) | RefSubscriberBase;
|
|
42
41
|
export interface Subscribable {
|
|
43
|
-
subscribe(listener: RefSubscriber):
|
|
42
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
44
43
|
}
|
|
45
44
|
export declare type FieldsRef<entityType> = {
|
|
46
45
|
[Properties in keyof OmitEB<entityType>]: entityType[Properties] extends {
|
|
@@ -227,7 +226,7 @@ export interface Repository<entityType> {
|
|
|
227
226
|
* @See [EntityMetadata](https://remult.dev/docs/ref_entitymetadata.html)
|
|
228
227
|
*/
|
|
229
228
|
metadata: EntityMetadata<entityType>;
|
|
230
|
-
addEventListener(listener: entityEventListener<entityType>):
|
|
229
|
+
addEventListener(listener: entityEventListener<entityType>): Unsubscribe;
|
|
231
230
|
}
|
|
232
231
|
export interface LiveQuery<entityType> {
|
|
233
232
|
subscribe(next: (info: LiveQueryChangeInfo<entityType>) => void): Unsubscribe;
|
package/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { SqlDatabase, } from './src/data-providers/sql-database';
|
|
|
14
14
|
export { CustomSqlFilterObject, CustomSqlFilterBuilder, dbNamesOf } from './src/filter/filter-consumer-bridge-to-sql-request';
|
|
15
15
|
export { JsonDataProvider, JsonEntityStorage } from './src/data-providers/json-data-provider';
|
|
16
16
|
export { Controller, BackendMethodOptions, BackendMethod, ProgressListener } from './src/server-action';
|
|
17
|
-
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource,
|
|
17
|
+
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource, UserInfo } from './src/context';
|
|
18
18
|
export { ExternalHttpProvider } from './src/buildRestDataProvider';
|
|
19
19
|
export { IdEntity } from './src/id-entity';
|
|
20
20
|
export { SortSegment, Sort } from './src/sort';
|
package/package.json
CHANGED
package/src/context.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { EntityMetadata, EntityRef, FindOptions, Repository } from "./remult3";
|
|
|
3
3
|
import { ClassType } from "../classType";
|
|
4
4
|
import type { SubscriptionServer } from "./live-query/SubscriptionServer";
|
|
5
5
|
import { ExternalHttpProvider } from "./buildRestDataProvider";
|
|
6
|
-
import { SubscriptionClient } from "./live-query/SubscriptionChannel";
|
|
6
|
+
import { SubscriptionClient, Unsubscribe } from "./live-query/SubscriptionChannel";
|
|
7
7
|
export declare function isBackend(): boolean;
|
|
8
8
|
export declare class Remult {
|
|
9
9
|
/**Return's a `Repository` of the specific entity type
|
|
@@ -102,9 +102,8 @@ export declare const queryConfig: {
|
|
|
102
102
|
defaultPageSize: number;
|
|
103
103
|
};
|
|
104
104
|
export interface EventDispatcher {
|
|
105
|
-
observe(what: () => any | Promise<any>): Promise<
|
|
105
|
+
observe(what: () => any | Promise<any>): Promise<Unsubscribe>;
|
|
106
106
|
}
|
|
107
|
-
export declare type Unobserve = () => void;
|
|
108
107
|
export declare class EventSource {
|
|
109
108
|
listeners: (() => {})[];
|
|
110
109
|
fire(): Promise<void>;
|
|
@@ -3,10 +3,11 @@ import { EntityOptions } from "../entity";
|
|
|
3
3
|
import { LookupColumn } from '../column';
|
|
4
4
|
import { EntityMetadata, FieldRef, FieldsRef, EntityFilter, FindOptions, Repository, EntityRef, QueryOptions, QueryResult, EntityOrderBy, FieldsMetadata, IdMetadata, FindFirstOptionsBase, FindFirstOptions, OmitEB, Subscribable, ControllerRef } from "./remult3";
|
|
5
5
|
import { ClassType } from "../../classType";
|
|
6
|
-
import { Remult
|
|
6
|
+
import { Remult } from "../context";
|
|
7
7
|
import { entityEventListener } from "../__EntityValueProvider";
|
|
8
8
|
import { DataProvider, EntityDataProvider, EntityDataProviderFindOptions } from "../data-interfaces";
|
|
9
9
|
import { RefSubscriber } from ".";
|
|
10
|
+
import { Unsubscribe } from "../live-query/SubscriptionChannel";
|
|
10
11
|
export declare class RepositoryImplementation<entityType> implements Repository<entityType> {
|
|
11
12
|
private entity;
|
|
12
13
|
remult: Remult;
|
|
@@ -72,7 +73,7 @@ declare abstract class rowHelperBase<T> {
|
|
|
72
73
|
set error(val: string);
|
|
73
74
|
constructor(columnsInfo: FieldOptions[], instance: T, remult: Remult);
|
|
74
75
|
_subscribers: SubscribableImp;
|
|
75
|
-
subscribe(listener: RefSubscriber):
|
|
76
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
76
77
|
_isLoading: boolean;
|
|
77
78
|
initSubscribers(): void;
|
|
78
79
|
get isLoading(): boolean;
|
|
@@ -148,7 +149,7 @@ export declare class FieldRefImplementation<entityType, valueType> implements Fi
|
|
|
148
149
|
private rowBase;
|
|
149
150
|
constructor(settings: FieldOptions, metadata: FieldMetadata, container: any, helper: EntityRef<entityType>, rowBase: rowHelperBase<entityType>);
|
|
150
151
|
_subscribers: SubscribableImp;
|
|
151
|
-
subscribe(listener: RefSubscriber):
|
|
152
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
152
153
|
valueIsNull(): boolean;
|
|
153
154
|
originalValueIsNull(): boolean;
|
|
154
155
|
load(): Promise<valueType>;
|
|
@@ -325,7 +326,7 @@ declare class SubscribableImp implements Subscribable {
|
|
|
325
326
|
subscribe(listener: (() => void) | {
|
|
326
327
|
reportChanged: () => void;
|
|
327
328
|
reportObserved: () => void;
|
|
328
|
-
}):
|
|
329
|
+
}): Unsubscribe;
|
|
329
330
|
}
|
|
330
331
|
export declare function getEntityMetadata<entityType>(entity: EntityMetadataOverloads<entityType>): EntityMetadata<entityType>;
|
|
331
332
|
export declare function getRepository<entityType>(entity: RepositoryOverloads<entityType>): Repository<entityType>;
|
|
@@ -1369,12 +1369,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1369
1369
|
rowHelperImplementation.prototype.save = function () {
|
|
1370
1370
|
var _a;
|
|
1371
1371
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1372
|
-
var doNotSave_1, _b, _c, col, e_22_1, d, ignoreKeys, _d, _e, field, f, updatedRow, changesOnly, wasChanged, key, element, err_1;
|
|
1373
|
-
var e_22,
|
|
1374
|
-
return tslib_1.__generator(this, function (
|
|
1375
|
-
switch (
|
|
1372
|
+
var doNotSave_1, _b, _c, col, e_22_1, d, ignoreKeys, _d, _e, field, f, updatedRow, isNew, changesOnly, wasChanged, key, element, _f, _g, listener, e_23_1, err_1;
|
|
1373
|
+
var e_22, _h, e_24, _j, e_23, _k;
|
|
1374
|
+
return tslib_1.__generator(this, function (_l) {
|
|
1375
|
+
switch (_l.label) {
|
|
1376
1376
|
case 0:
|
|
1377
|
-
|
|
1377
|
+
_l.trys.push([0, , 34, 35]);
|
|
1378
1378
|
if (this._saving)
|
|
1379
1379
|
throw new Error("cannot save while entity is already saving");
|
|
1380
1380
|
this._saving = true;
|
|
@@ -1383,32 +1383,32 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1383
1383
|
this.isLoading = true;
|
|
1384
1384
|
return [4 /*yield*/, this.__validateEntity()];
|
|
1385
1385
|
case 1:
|
|
1386
|
-
|
|
1386
|
+
_l.sent();
|
|
1387
1387
|
doNotSave_1 = false;
|
|
1388
|
-
|
|
1388
|
+
_l.label = 2;
|
|
1389
1389
|
case 2:
|
|
1390
|
-
|
|
1390
|
+
_l.trys.push([2, 7, 8, 9]);
|
|
1391
1391
|
_b = tslib_1.__values(this.fields), _c = _b.next();
|
|
1392
|
-
|
|
1392
|
+
_l.label = 3;
|
|
1393
1393
|
case 3:
|
|
1394
1394
|
if (!!_c.done) return [3 /*break*/, 6];
|
|
1395
1395
|
col = _c.value;
|
|
1396
1396
|
if (!col.metadata.options.saving) return [3 /*break*/, 5];
|
|
1397
1397
|
return [4 /*yield*/, col.metadata.options.saving(this.instance, col)];
|
|
1398
1398
|
case 4:
|
|
1399
|
-
|
|
1400
|
-
|
|
1399
|
+
_l.sent();
|
|
1400
|
+
_l.label = 5;
|
|
1401
1401
|
case 5:
|
|
1402
1402
|
_c = _b.next();
|
|
1403
1403
|
return [3 /*break*/, 3];
|
|
1404
1404
|
case 6: return [3 /*break*/, 9];
|
|
1405
1405
|
case 7:
|
|
1406
|
-
e_22_1 =
|
|
1406
|
+
e_22_1 = _l.sent();
|
|
1407
1407
|
e_22 = { error: e_22_1 };
|
|
1408
1408
|
return [3 /*break*/, 9];
|
|
1409
1409
|
case 8:
|
|
1410
1410
|
try {
|
|
1411
|
-
if (_c && !_c.done && (
|
|
1411
|
+
if (_c && !_c.done && (_h = _b.return)) _h.call(_b);
|
|
1412
1412
|
}
|
|
1413
1413
|
finally { if (e_22) throw e_22.error; }
|
|
1414
1414
|
return [7 /*endfinally*/];
|
|
@@ -1416,8 +1416,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1416
1416
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
1417
1417
|
return [4 /*yield*/, this.info.entityInfo.saving(this.instance, function () { return doNotSave_1 = true; })];
|
|
1418
1418
|
case 10:
|
|
1419
|
-
|
|
1420
|
-
|
|
1419
|
+
_l.sent();
|
|
1420
|
+
_l.label = 11;
|
|
1421
1421
|
case 11:
|
|
1422
1422
|
this.__assertValidity();
|
|
1423
1423
|
d = this.copyDataToObject();
|
|
@@ -1433,24 +1433,25 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
catch (
|
|
1436
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1437
1437
|
finally {
|
|
1438
1438
|
try {
|
|
1439
|
-
if (_e && !_e.done && (
|
|
1439
|
+
if (_e && !_e.done && (_j = _d.return)) _j.call(_d);
|
|
1440
1440
|
}
|
|
1441
|
-
finally { if (
|
|
1441
|
+
finally { if (e_24) throw e_24.error; }
|
|
1442
1442
|
}
|
|
1443
1443
|
if (this.info.idMetadata.field instanceof column_1.CompoundIdField)
|
|
1444
1444
|
delete (d.id);
|
|
1445
1445
|
updatedRow = void 0;
|
|
1446
|
-
|
|
1446
|
+
isNew = this.isNew();
|
|
1447
|
+
_l.label = 12;
|
|
1447
1448
|
case 12:
|
|
1448
|
-
|
|
1449
|
+
_l.trys.push([12, 31, , 33]);
|
|
1449
1450
|
(_a = this._subscribers) === null || _a === void 0 ? void 0 : _a.reportChanged();
|
|
1450
1451
|
if (!this.isNew()) return [3 /*break*/, 14];
|
|
1451
1452
|
return [4 /*yield*/, this.edp.insert(d)];
|
|
1452
1453
|
case 13:
|
|
1453
|
-
updatedRow =
|
|
1454
|
+
updatedRow = _l.sent();
|
|
1454
1455
|
return [3 /*break*/, 18];
|
|
1455
1456
|
case 14:
|
|
1456
1457
|
changesOnly = {};
|
|
@@ -1469,39 +1470,67 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1469
1470
|
if (!doNotSave_1) return [3 /*break*/, 16];
|
|
1470
1471
|
return [4 /*yield*/, this.edp.find({ where: this.getIdFilter() })];
|
|
1471
1472
|
case 15:
|
|
1472
|
-
updatedRow = (
|
|
1473
|
+
updatedRow = (_l.sent())[0];
|
|
1473
1474
|
return [3 /*break*/, 18];
|
|
1474
1475
|
case 16: return [4 /*yield*/, this.edp.update(this.id, changesOnly)];
|
|
1475
1476
|
case 17:
|
|
1476
|
-
updatedRow =
|
|
1477
|
-
|
|
1477
|
+
updatedRow = _l.sent();
|
|
1478
|
+
_l.label = 18;
|
|
1478
1479
|
case 18: return [4 /*yield*/, this.loadDataFrom(updatedRow)];
|
|
1479
1480
|
case 19:
|
|
1480
|
-
|
|
1481
|
+
_l.sent();
|
|
1481
1482
|
if (!this.info.entityInfo.saved) return [3 /*break*/, 21];
|
|
1482
1483
|
return [4 /*yield*/, this.info.entityInfo.saved(this.instance)];
|
|
1483
1484
|
case 20:
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
case 21:
|
|
1485
|
+
_l.sent();
|
|
1486
|
+
_l.label = 21;
|
|
1487
|
+
case 21:
|
|
1488
|
+
if (!this.repository.listeners) return [3 /*break*/, 29];
|
|
1489
|
+
_l.label = 22;
|
|
1487
1490
|
case 22:
|
|
1488
|
-
|
|
1491
|
+
_l.trys.push([22, 27, 28, 29]);
|
|
1492
|
+
_f = tslib_1.__values(this.repository.listeners.filter(function (x) { return x.saved; })), _g = _f.next();
|
|
1493
|
+
_l.label = 23;
|
|
1494
|
+
case 23:
|
|
1495
|
+
if (!!_g.done) return [3 /*break*/, 26];
|
|
1496
|
+
listener = _g.value;
|
|
1497
|
+
return [4 /*yield*/, listener.saved(this.instance, isNew)];
|
|
1498
|
+
case 24:
|
|
1499
|
+
_l.sent();
|
|
1500
|
+
_l.label = 25;
|
|
1501
|
+
case 25:
|
|
1502
|
+
_g = _f.next();
|
|
1503
|
+
return [3 /*break*/, 23];
|
|
1504
|
+
case 26: return [3 /*break*/, 29];
|
|
1505
|
+
case 27:
|
|
1506
|
+
e_23_1 = _l.sent();
|
|
1507
|
+
e_23 = { error: e_23_1 };
|
|
1508
|
+
return [3 /*break*/, 29];
|
|
1509
|
+
case 28:
|
|
1510
|
+
try {
|
|
1511
|
+
if (_g && !_g.done && (_k = _f.return)) _k.call(_f);
|
|
1512
|
+
}
|
|
1513
|
+
finally { if (e_23) throw e_23.error; }
|
|
1514
|
+
return [7 /*endfinally*/];
|
|
1515
|
+
case 29: return [4 /*yield*/, this.repository.remult.liveQueryPublisher.itemChanged(this.repository.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }])];
|
|
1516
|
+
case 30:
|
|
1517
|
+
_l.sent();
|
|
1489
1518
|
this.saveOriginalData();
|
|
1490
1519
|
this._isNew = false;
|
|
1491
1520
|
return [2 /*return*/, this.instance];
|
|
1492
|
-
case
|
|
1493
|
-
err_1 =
|
|
1521
|
+
case 31:
|
|
1522
|
+
err_1 = _l.sent();
|
|
1494
1523
|
return [4 /*yield*/, this.catchSaveErrors(err_1)];
|
|
1495
|
-
case
|
|
1496
|
-
|
|
1497
|
-
return [3 /*break*/,
|
|
1498
|
-
case
|
|
1499
|
-
case
|
|
1524
|
+
case 32:
|
|
1525
|
+
_l.sent();
|
|
1526
|
+
return [3 /*break*/, 33];
|
|
1527
|
+
case 33: return [3 /*break*/, 35];
|
|
1528
|
+
case 34:
|
|
1500
1529
|
this.isLoading = false;
|
|
1501
1530
|
this._reportChangedToEntityAndFields();
|
|
1502
1531
|
this._saving = false;
|
|
1503
1532
|
return [7 /*endfinally*/];
|
|
1504
|
-
case
|
|
1533
|
+
case 35: return [2 /*return*/];
|
|
1505
1534
|
}
|
|
1506
1535
|
});
|
|
1507
1536
|
});
|
|
@@ -1511,8 +1540,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1511
1540
|
};
|
|
1512
1541
|
rowHelperImplementation.prototype.delete = function () {
|
|
1513
1542
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1514
|
-
var _a, _b, listener,
|
|
1515
|
-
var
|
|
1543
|
+
var _a, _b, listener, e_25_1, err_2;
|
|
1544
|
+
var e_25, _c;
|
|
1516
1545
|
return tslib_1.__generator(this, function (_d) {
|
|
1517
1546
|
switch (_d.label) {
|
|
1518
1547
|
case 0:
|
|
@@ -1554,14 +1583,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1554
1583
|
return [3 /*break*/, 8];
|
|
1555
1584
|
case 11: return [3 /*break*/, 14];
|
|
1556
1585
|
case 12:
|
|
1557
|
-
|
|
1558
|
-
|
|
1586
|
+
e_25_1 = _d.sent();
|
|
1587
|
+
e_25 = { error: e_25_1 };
|
|
1559
1588
|
return [3 /*break*/, 14];
|
|
1560
1589
|
case 13:
|
|
1561
1590
|
try {
|
|
1562
1591
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1563
1592
|
}
|
|
1564
|
-
finally { if (
|
|
1593
|
+
finally { if (e_25) throw e_25.error; }
|
|
1565
1594
|
return [7 /*endfinally*/];
|
|
1566
1595
|
case 14: return [4 /*yield*/, this.repository.remult.liveQueryPublisher.itemChanged(this.repository.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: true }])];
|
|
1567
1596
|
case 15:
|
|
@@ -1581,8 +1610,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1581
1610
|
};
|
|
1582
1611
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
1583
1612
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1584
|
-
var _a, _b, col, lu,
|
|
1585
|
-
var
|
|
1613
|
+
var _a, _b, col, lu, e_26_1;
|
|
1614
|
+
var e_26, _c;
|
|
1586
1615
|
return tslib_1.__generator(this, function (_d) {
|
|
1587
1616
|
switch (_d.label) {
|
|
1588
1617
|
case 0:
|
|
@@ -1617,14 +1646,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1617
1646
|
return [3 /*break*/, 1];
|
|
1618
1647
|
case 9: return [3 /*break*/, 12];
|
|
1619
1648
|
case 10:
|
|
1620
|
-
|
|
1621
|
-
|
|
1649
|
+
e_26_1 = _d.sent();
|
|
1650
|
+
e_26 = { error: e_26_1 };
|
|
1622
1651
|
return [3 /*break*/, 12];
|
|
1623
1652
|
case 11:
|
|
1624
1653
|
try {
|
|
1625
1654
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1626
1655
|
}
|
|
1627
|
-
finally { if (
|
|
1656
|
+
finally { if (e_26) throw e_26.error; }
|
|
1628
1657
|
return [7 /*endfinally*/];
|
|
1629
1658
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
1630
1659
|
case 13:
|
|
@@ -1640,8 +1669,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1640
1669
|
};
|
|
1641
1670
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
1642
1671
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1643
|
-
var _a, _b, col, _c, _d,
|
|
1644
|
-
var
|
|
1672
|
+
var _a, _b, col, _c, _d, e_27_1;
|
|
1673
|
+
var e_27, _e;
|
|
1645
1674
|
return tslib_1.__generator(this, function (_f) {
|
|
1646
1675
|
switch (_f.label) {
|
|
1647
1676
|
case 0:
|
|
@@ -1666,14 +1695,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1666
1695
|
return [3 /*break*/, 2];
|
|
1667
1696
|
case 5: return [3 /*break*/, 8];
|
|
1668
1697
|
case 6:
|
|
1669
|
-
|
|
1670
|
-
|
|
1698
|
+
e_27_1 = _f.sent();
|
|
1699
|
+
e_27 = { error: e_27_1 };
|
|
1671
1700
|
return [3 /*break*/, 8];
|
|
1672
1701
|
case 7:
|
|
1673
1702
|
try {
|
|
1674
1703
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1675
1704
|
}
|
|
1676
|
-
finally { if (
|
|
1705
|
+
finally { if (e_27) throw e_27.error; }
|
|
1677
1706
|
return [7 /*endfinally*/];
|
|
1678
1707
|
case 8: return [2 /*return*/];
|
|
1679
1708
|
}
|
|
@@ -1686,7 +1715,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1686
1715
|
return this._isNew;
|
|
1687
1716
|
};
|
|
1688
1717
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
1689
|
-
var
|
|
1718
|
+
var e_28, _a;
|
|
1690
1719
|
var _b;
|
|
1691
1720
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
1692
1721
|
try {
|
|
@@ -1696,19 +1725,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1696
1725
|
return true;
|
|
1697
1726
|
}
|
|
1698
1727
|
}
|
|
1699
|
-
catch (
|
|
1728
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
1700
1729
|
finally {
|
|
1701
1730
|
try {
|
|
1702
1731
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1703
1732
|
}
|
|
1704
|
-
finally { if (
|
|
1733
|
+
finally { if (e_28) throw e_28.error; }
|
|
1705
1734
|
}
|
|
1706
1735
|
return false;
|
|
1707
1736
|
};
|
|
1708
1737
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
1709
1738
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1710
|
-
var _a, _b, c, col,
|
|
1711
|
-
var
|
|
1739
|
+
var _a, _b, c, col, e_29_1, _c, _d, listener, e_30_1;
|
|
1740
|
+
var e_29, _e, e_30, _f;
|
|
1712
1741
|
return tslib_1.__generator(this, function (_g) {
|
|
1713
1742
|
switch (_g.label) {
|
|
1714
1743
|
case 0:
|
|
@@ -1729,14 +1758,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1729
1758
|
return [3 /*break*/, 1];
|
|
1730
1759
|
case 4: return [3 /*break*/, 7];
|
|
1731
1760
|
case 5:
|
|
1732
|
-
|
|
1733
|
-
|
|
1761
|
+
e_29_1 = _g.sent();
|
|
1762
|
+
e_29 = { error: e_29_1 };
|
|
1734
1763
|
return [3 /*break*/, 7];
|
|
1735
1764
|
case 6:
|
|
1736
1765
|
try {
|
|
1737
1766
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1738
1767
|
}
|
|
1739
|
-
finally { if (
|
|
1768
|
+
finally { if (e_29) throw e_29.error; }
|
|
1740
1769
|
return [7 /*endfinally*/];
|
|
1741
1770
|
case 7:
|
|
1742
1771
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -1763,14 +1792,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1763
1792
|
return [3 /*break*/, 11];
|
|
1764
1793
|
case 14: return [3 /*break*/, 17];
|
|
1765
1794
|
case 15:
|
|
1766
|
-
|
|
1767
|
-
|
|
1795
|
+
e_30_1 = _g.sent();
|
|
1796
|
+
e_30 = { error: e_30_1 };
|
|
1768
1797
|
return [3 /*break*/, 17];
|
|
1769
1798
|
case 16:
|
|
1770
1799
|
try {
|
|
1771
1800
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
1772
1801
|
}
|
|
1773
|
-
finally { if (
|
|
1802
|
+
finally { if (e_30) throw e_30.error; }
|
|
1774
1803
|
return [7 /*endfinally*/];
|
|
1775
1804
|
case 17: return [2 /*return*/];
|
|
1776
1805
|
}
|
|
@@ -1813,7 +1842,7 @@ exports.getControllerRef = getControllerRef;
|
|
|
1813
1842
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
1814
1843
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
1815
1844
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
1816
|
-
var _a,
|
|
1845
|
+
var _a, e_31, _b;
|
|
1817
1846
|
var _this = _super.call(this, columnsInfo, instance, remult) || this;
|
|
1818
1847
|
var _items = [];
|
|
1819
1848
|
var r = (_a = {
|
|
@@ -1828,20 +1857,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1828
1857
|
_items.push(r[col.key] = new FieldRefImplementation(col, new columnDefsImpl(col, undefined, remult), instance, undefined, _this));
|
|
1829
1858
|
}
|
|
1830
1859
|
}
|
|
1831
|
-
catch (
|
|
1860
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
1832
1861
|
finally {
|
|
1833
1862
|
try {
|
|
1834
1863
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
1835
1864
|
}
|
|
1836
|
-
finally { if (
|
|
1865
|
+
finally { if (e_31) throw e_31.error; }
|
|
1837
1866
|
}
|
|
1838
1867
|
_this.fields = r;
|
|
1839
1868
|
return _this;
|
|
1840
1869
|
}
|
|
1841
1870
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
1842
1871
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1843
|
-
var _a, _b, col,
|
|
1844
|
-
var
|
|
1872
|
+
var _a, _b, col, e_32_1;
|
|
1873
|
+
var e_32, _c;
|
|
1845
1874
|
return tslib_1.__generator(this, function (_d) {
|
|
1846
1875
|
switch (_d.label) {
|
|
1847
1876
|
case 0:
|
|
@@ -1861,14 +1890,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1861
1890
|
return [3 /*break*/, 1];
|
|
1862
1891
|
case 4: return [3 /*break*/, 7];
|
|
1863
1892
|
case 5:
|
|
1864
|
-
|
|
1865
|
-
|
|
1893
|
+
e_32_1 = _d.sent();
|
|
1894
|
+
e_32 = { error: e_32_1 };
|
|
1866
1895
|
return [3 /*break*/, 7];
|
|
1867
1896
|
case 6:
|
|
1868
1897
|
try {
|
|
1869
1898
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1870
1899
|
}
|
|
1871
|
-
finally { if (
|
|
1900
|
+
finally { if (e_32) throw e_32.error; }
|
|
1872
1901
|
return [7 /*endfinally*/];
|
|
1873
1902
|
case 7: return [2 /*return*/];
|
|
1874
1903
|
}
|
|
@@ -2033,8 +2062,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
2033
2062
|
};
|
|
2034
2063
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
2035
2064
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2036
|
-
var x, _a, _b, v,
|
|
2037
|
-
var
|
|
2065
|
+
var x, _a, _b, v, e_33_1, error_1;
|
|
2066
|
+
var e_33, _c;
|
|
2038
2067
|
return tslib_1.__generator(this, function (_d) {
|
|
2039
2068
|
switch (_d.label) {
|
|
2040
2069
|
case 0:
|
|
@@ -2058,14 +2087,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
2058
2087
|
return [3 /*break*/, 2];
|
|
2059
2088
|
case 5: return [3 /*break*/, 8];
|
|
2060
2089
|
case 6:
|
|
2061
|
-
|
|
2062
|
-
|
|
2090
|
+
e_33_1 = _d.sent();
|
|
2091
|
+
e_33 = { error: e_33_1 };
|
|
2063
2092
|
return [3 /*break*/, 8];
|
|
2064
2093
|
case 7:
|
|
2065
2094
|
try {
|
|
2066
2095
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2067
2096
|
}
|
|
2068
|
-
finally { if (
|
|
2097
|
+
finally { if (e_33) throw e_33.error; }
|
|
2069
2098
|
return [7 /*endfinally*/];
|
|
2070
2099
|
case 8: return [3 /*break*/, 11];
|
|
2071
2100
|
case 9:
|
|
@@ -2206,7 +2235,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
2206
2235
|
exports.columnDefsImpl = columnDefsImpl;
|
|
2207
2236
|
var EntityFullInfo = /** @class */ (function () {
|
|
2208
2237
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
2209
|
-
var _a,
|
|
2238
|
+
var _a, e_34, _b;
|
|
2210
2239
|
var _this = this;
|
|
2211
2240
|
this.columnsInfo = columnsInfo;
|
|
2212
2241
|
this.entityInfo = entityInfo;
|
|
@@ -2276,12 +2305,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
2276
2305
|
_items.push(r[x.key] = new columnDefsImpl(x, this, remult));
|
|
2277
2306
|
}
|
|
2278
2307
|
}
|
|
2279
|
-
catch (
|
|
2308
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2280
2309
|
finally {
|
|
2281
2310
|
try {
|
|
2282
2311
|
if (columnsInfo_3_1 && !columnsInfo_3_1.done && (_b = columnsInfo_3.return)) _b.call(columnsInfo_3);
|
|
2283
2312
|
}
|
|
2284
|
-
finally { if (
|
|
2313
|
+
finally { if (e_34) throw e_34.error; }
|
|
2285
2314
|
}
|
|
2286
2315
|
this.fields = r;
|
|
2287
2316
|
this.caption = buildCaption(entityInfo.caption, this.key, remult);
|
|
@@ -2504,7 +2533,7 @@ function ValueListFieldType() {
|
|
|
2504
2533
|
exports.ValueListFieldType = ValueListFieldType;
|
|
2505
2534
|
var ValueListInfo = /** @class */ (function () {
|
|
2506
2535
|
function ValueListInfo(valueListType) {
|
|
2507
|
-
var
|
|
2536
|
+
var e_35, _a, _b;
|
|
2508
2537
|
var _this = this;
|
|
2509
2538
|
this.valueListType = valueListType;
|
|
2510
2539
|
this.byIdMap = new Map();
|
|
@@ -2542,12 +2571,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
2542
2571
|
}
|
|
2543
2572
|
}
|
|
2544
2573
|
}
|
|
2545
|
-
catch (
|
|
2574
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
2546
2575
|
finally {
|
|
2547
2576
|
try {
|
|
2548
2577
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
2549
2578
|
}
|
|
2550
|
-
finally { if (
|
|
2579
|
+
finally { if (e_35) throw e_35.error; }
|
|
2551
2580
|
}
|
|
2552
2581
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
2553
2582
|
throw new Error("ValueType " + this.valueListType + " has values without an id");
|
|
@@ -2677,7 +2706,7 @@ function Field(valueType) {
|
|
|
2677
2706
|
exports.Field = Field;
|
|
2678
2707
|
exports.storableMember = Symbol("storableMember");
|
|
2679
2708
|
function buildOptions(options, remult) {
|
|
2680
|
-
var
|
|
2709
|
+
var e_36, _a;
|
|
2681
2710
|
var r = {};
|
|
2682
2711
|
try {
|
|
2683
2712
|
for (var options_2 = tslib_1.__values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) {
|
|
@@ -2690,12 +2719,12 @@ function buildOptions(options, remult) {
|
|
|
2690
2719
|
}
|
|
2691
2720
|
}
|
|
2692
2721
|
}
|
|
2693
|
-
catch (
|
|
2722
|
+
catch (e_36_1) { e_36 = { error: e_36_1 }; }
|
|
2694
2723
|
finally {
|
|
2695
2724
|
try {
|
|
2696
2725
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
2697
2726
|
}
|
|
2698
|
-
finally { if (
|
|
2727
|
+
finally { if (e_36) throw e_36.error; }
|
|
2699
2728
|
}
|
|
2700
2729
|
return r;
|
|
2701
2730
|
}
|
|
@@ -2803,7 +2832,7 @@ function Entity(key) {
|
|
|
2803
2832
|
}
|
|
2804
2833
|
}
|
|
2805
2834
|
var factory = function (remult) {
|
|
2806
|
-
var
|
|
2835
|
+
var e_37, _a;
|
|
2807
2836
|
var r = {};
|
|
2808
2837
|
try {
|
|
2809
2838
|
for (var options_3 = tslib_1.__values(options), options_3_1 = options_3.next(); !options_3_1.done; options_3_1 = options_3.next()) {
|
|
@@ -2816,12 +2845,12 @@ function Entity(key) {
|
|
|
2816
2845
|
}
|
|
2817
2846
|
}
|
|
2818
2847
|
}
|
|
2819
|
-
catch (
|
|
2848
|
+
catch (e_37_1) { e_37 = { error: e_37_1 }; }
|
|
2820
2849
|
finally {
|
|
2821
2850
|
try {
|
|
2822
2851
|
if (options_3_1 && !options_3_1.done && (_a = options_3.return)) _a.call(options_3);
|
|
2823
2852
|
}
|
|
2824
|
-
finally { if (
|
|
2853
|
+
finally { if (e_37) throw e_37.error; }
|
|
2825
2854
|
}
|
|
2826
2855
|
var base = Object.getPrototypeOf(target);
|
|
2827
2856
|
if (base) {
|
|
@@ -2931,9 +2960,9 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2931
2960
|
});
|
|
2932
2961
|
};
|
|
2933
2962
|
QueryResultImpl.prototype.forEach = function (what) {
|
|
2934
|
-
var
|
|
2963
|
+
var e_38, _a;
|
|
2935
2964
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2936
|
-
var i, _b, _c, x,
|
|
2965
|
+
var i, _b, _c, x, e_38_1;
|
|
2937
2966
|
return tslib_1.__generator(this, function (_d) {
|
|
2938
2967
|
switch (_d.label) {
|
|
2939
2968
|
case 0:
|
|
@@ -2955,8 +2984,8 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2955
2984
|
case 5: return [3 /*break*/, 2];
|
|
2956
2985
|
case 6: return [3 /*break*/, 13];
|
|
2957
2986
|
case 7:
|
|
2958
|
-
|
|
2959
|
-
|
|
2987
|
+
e_38_1 = _d.sent();
|
|
2988
|
+
e_38 = { error: e_38_1 };
|
|
2960
2989
|
return [3 /*break*/, 13];
|
|
2961
2990
|
case 8:
|
|
2962
2991
|
_d.trys.push([8, , 11, 12]);
|
|
@@ -2967,7 +2996,7 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2967
2996
|
_d.label = 10;
|
|
2968
2997
|
case 10: return [3 /*break*/, 12];
|
|
2969
2998
|
case 11:
|
|
2970
|
-
if (
|
|
2999
|
+
if (e_38) throw e_38.error;
|
|
2971
3000
|
return [7 /*endfinally*/];
|
|
2972
3001
|
case 12: return [7 /*endfinally*/];
|
|
2973
3002
|
case 13: return [2 /*return*/, i];
|
package/src/remult3/remult3.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ClassType } from "../../classType";
|
|
2
2
|
import { FieldMetadata } from "../column-interfaces";
|
|
3
|
-
import { Unobserve } from "../context";
|
|
4
3
|
import { LiveQueryChange, SubscriptionListener, Unsubscribe } from "../live-query/SubscriptionChannel";
|
|
5
4
|
import { EntityOptions } from "../entity";
|
|
6
5
|
import { SortSegment } from "../sort";
|
|
@@ -40,7 +39,7 @@ export interface RefSubscriberBase {
|
|
|
40
39
|
}
|
|
41
40
|
export declare type RefSubscriber = (() => void) | RefSubscriberBase;
|
|
42
41
|
export interface Subscribable {
|
|
43
|
-
subscribe(listener: RefSubscriber):
|
|
42
|
+
subscribe(listener: RefSubscriber): Unsubscribe;
|
|
44
43
|
}
|
|
45
44
|
export declare type FieldsRef<entityType> = {
|
|
46
45
|
[Properties in keyof OmitEB<entityType>]: entityType[Properties] extends {
|
|
@@ -227,7 +226,7 @@ export interface Repository<entityType> {
|
|
|
227
226
|
* @See [EntityMetadata](https://remult.dev/docs/ref_entitymetadata.html)
|
|
228
227
|
*/
|
|
229
228
|
metadata: EntityMetadata<entityType>;
|
|
230
|
-
addEventListener(listener: entityEventListener<entityType>):
|
|
229
|
+
addEventListener(listener: entityEventListener<entityType>): Unsubscribe;
|
|
231
230
|
}
|
|
232
231
|
export interface LiveQuery<entityType> {
|
|
233
232
|
subscribe(next: (info: LiveQueryChangeInfo<entityType>) => void): Unsubscribe;
|