remult 3.3.0-next.1 → 3.3.1
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/graphql.js +1 -1
- package/esm/remult-knex/index.js +10 -3
- package/esm/remult-mongo.js +7 -3
- package/esm/server/get-remult-admin-html.js +125 -111
- package/esm/server/remult-admin.js +2 -0
- package/esm/server/remult-api-server.js +1 -1
- package/esm/src/data-api.js +30 -19
- package/esm/src/data-providers/rest-data-provider.js +48 -37
- package/esm/src/data-providers/sql-database.js +14 -3
- package/esm/src/live-query/SubscriptionChannel.js +52 -4
- package/esm/src/remult-proxy.js +4 -4
- package/esm/src/remult3/RepositoryImplementation.js +53 -25
- package/esm/src/server-action.js +2 -2
- package/esm/src/valueConverters.js +9 -5
- package/graphql.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/remult-knex/index.js +18 -9
- package/remult-mongo.js +6 -2
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-admin.d.ts +2 -0
- package/server/remult-admin.js +2 -1
- package/server/remult-api-server.js +1 -0
- package/src/data-api.d.ts +4 -4
- package/src/data-api.js +50 -30
- package/src/data-interfaces.d.ts +6 -6
- package/src/data-providers/rest-data-provider.d.ts +4 -4
- package/src/data-providers/rest-data-provider.js +48 -37
- package/src/data-providers/sql-database.js +14 -3
- package/src/live-query/SubscriptionChannel.d.ts +52 -4
- package/src/live-query/SubscriptionChannel.js +52 -4
- package/src/remult-proxy.js +4 -4
- package/src/remult3/RepositoryImplementation.d.ts +11 -10
- package/src/remult3/RepositoryImplementation.js +237 -177
- package/src/remult3/remult3.d.ts +25 -23
- package/src/server-action.js +2 -2
- package/src/valueConverters.d.ts +3 -1
- package/src/valueConverters.js +9 -6
package/src/remult-proxy.js
CHANGED
|
@@ -195,11 +195,11 @@ var RemultProxy = /** @class */ (function () {
|
|
|
195
195
|
.repo.apply(_b, tslib_1.__spreadArray([], tslib_1.__read(args), false)))
|
|
196
196
|
.getEntityRef.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args2), false));
|
|
197
197
|
},
|
|
198
|
-
_a.insert = function (args2) {
|
|
198
|
+
_a.insert = function (args2, args3) {
|
|
199
199
|
var _a;
|
|
200
200
|
return (_a = self
|
|
201
201
|
.remultFactory())
|
|
202
|
-
.repo.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args), false)).insert(args2);
|
|
202
|
+
.repo.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args), false)).insert(args2, args3);
|
|
203
203
|
},
|
|
204
204
|
_a.liveQuery = function () {
|
|
205
205
|
var _a, _b;
|
|
@@ -238,11 +238,11 @@ var RemultProxy = /** @class */ (function () {
|
|
|
238
238
|
.remultFactory())
|
|
239
239
|
.repo.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args), false)).upsert(args2);
|
|
240
240
|
},
|
|
241
|
-
_a.update = function (a, b) {
|
|
241
|
+
_a.update = function (a, b, c) {
|
|
242
242
|
var _a;
|
|
243
243
|
return (_a = self
|
|
244
244
|
.remultFactory())
|
|
245
|
-
.repo.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args), false)).update(a, b);
|
|
245
|
+
.repo.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(args), false)).update(a, b, c);
|
|
246
246
|
},
|
|
247
247
|
_a);
|
|
248
248
|
entityCache.set(args[1], result);
|
|
@@ -5,8 +5,8 @@ import { Remult } from '../context.js';
|
|
|
5
5
|
import type { EntityOptions } from '../entity.js';
|
|
6
6
|
import { Filter } from '../filter/filter-interfaces.js';
|
|
7
7
|
import { type GroupByOptions, type GroupByResult, type ControllerRef, type ControllerRefForControllerBase, type EntityFilter, type EntityMetadata, type EntityOrderBy, type EntityRef, type EntityRefForEntityBase, type FieldRef, type FieldsMetadata, type FieldsRef, type FieldsRefForEntityBase, type FindFirstOptions, type FindFirstOptionsBase, type FindOptions, type IdMetadata, type LiveQuery, type LoadOptions, type MembersOnly, type NumericKeys, type Repository, type RepositoryRelations, type idType } from './remult3.js';
|
|
8
|
-
import type { QueryOptions, RefSubscriber, UpsertOptions } from './remult3.js';
|
|
9
|
-
import type { entityEventListener } from '../__EntityValueProvider.js';
|
|
8
|
+
import type { InsertOrUpdateOptions, QueryOptions, RefSubscriber, UpsertOptions } from './remult3.js';
|
|
9
|
+
import type { entityEventListener, packedRowInfo } from '../__EntityValueProvider.js';
|
|
10
10
|
import { type DataProvider, type EntityDataProvider, type EntityDataProviderGroupByOptions, type EntityDataProviderFindOptions, type ErrorInfo, EntityError } from '../data-interfaces.js';
|
|
11
11
|
import type { Unsubscribe } from '../live-query/SubscriptionChannel.js';
|
|
12
12
|
import { RelationLoader } from './relation-loader.js';
|
|
@@ -50,8 +50,8 @@ export declare class RepositoryImplementation<entityType> implements Repository<
|
|
|
50
50
|
delete(id: idType<entityType>): Promise<void>;
|
|
51
51
|
delete(item: Partial<MembersOnly<entityType>>): Promise<void>;
|
|
52
52
|
__cleanupPartialObject(item: Partial<MembersOnly<entityType>>): void;
|
|
53
|
-
insert(item: Partial<MembersOnly<entityType>>[]): Promise<entityType[]>;
|
|
54
|
-
insert(item: Partial<MembersOnly<entityType
|
|
53
|
+
insert(item: Partial<MembersOnly<entityType>>[], options?: InsertOrUpdateOptions): Promise<entityType[]>;
|
|
54
|
+
insert(item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
|
|
55
55
|
get fields(): FieldsMetadata<entityType>;
|
|
56
56
|
validate(entity: Partial<MembersOnly<entityType>>, ...fields: Extract<keyof MembersOnly<entityType>, string>[]): Promise<ErrorInfo<entityType> | undefined>;
|
|
57
57
|
private __createDto;
|
|
@@ -59,13 +59,13 @@ export declare class RepositoryImplementation<entityType> implements Repository<
|
|
|
59
59
|
where: EntityFilter<entityType>;
|
|
60
60
|
set: Partial<MembersOnly<entityType>>;
|
|
61
61
|
}): Promise<number>;
|
|
62
|
-
update(id: idType<entityType>, item: Partial<MembersOnly<entityType
|
|
63
|
-
update(originalItem: Partial<MembersOnly<entityType>>, item: Partial<MembersOnly<entityType
|
|
62
|
+
update(id: idType<entityType>, item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
|
|
63
|
+
update(originalItem: Partial<MembersOnly<entityType>>, item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
|
|
64
64
|
upsert(options: UpsertOptions<entityType>[]): Promise<entityType[]>;
|
|
65
65
|
upsert(options: UpsertOptions<entityType>): Promise<entityType>;
|
|
66
66
|
private _getRefForExistingRow;
|
|
67
|
-
save(item: Partial<MembersOnly<entityType>>[]): Promise<entityType[]>;
|
|
68
|
-
save(item: Partial<MembersOnly<entityType
|
|
67
|
+
save(item: Partial<MembersOnly<entityType>>[], options?: InsertOrUpdateOptions): Promise<entityType[]>;
|
|
68
|
+
save(item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
|
|
69
69
|
liveQuery(options?: FindOptions<entityType>): LiveQuery<entityType>;
|
|
70
70
|
_rawFind(options: FindOptions<entityType> | undefined, skipOrderByAndLimit: boolean | undefined, loader: RelationLoader, actualFind: (ops: EntityDataProviderFindOptions) => Promise<any[]>): Promise<entityType[]>;
|
|
71
71
|
find(options?: FindOptions<entityType>): Promise<entityType[]>;
|
|
@@ -136,6 +136,7 @@ export declare class rowHelperImplementation<T> extends rowHelperBase<T> impleme
|
|
|
136
136
|
private repo;
|
|
137
137
|
private edp;
|
|
138
138
|
private _isNew;
|
|
139
|
+
_updateResultsFromServerAction(rowInfo: packedRowInfo): Promise<void>;
|
|
139
140
|
constructor(info: EntityFullInfo<T>, instance: T, repo: RepositoryImplementation<T>, edp: EntityDataProvider, remult: Remult, _isNew: boolean, excludeRelationMembers?: Set<string>);
|
|
140
141
|
repository: Repository<unknown>;
|
|
141
142
|
clone(): T;
|
|
@@ -153,7 +154,7 @@ export declare class rowHelperImplementation<T> extends rowHelperBase<T> impleme
|
|
|
153
154
|
private _columns?;
|
|
154
155
|
get fields(): FieldsRef<T>;
|
|
155
156
|
private _saving;
|
|
156
|
-
save(onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject?: string[]): Promise<T>;
|
|
157
|
+
save(options: InsertOrUpdateOptions | undefined, onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject?: string[]): Promise<T>;
|
|
157
158
|
processInsertResponseDto(updatedRow: any): Promise<T>;
|
|
158
159
|
buildDtoForInsert(): Promise<any>;
|
|
159
160
|
private buildLifeCycleEvent;
|
|
@@ -327,7 +328,7 @@ export declare function buildOptions<entityType = unknown, valueType = unknown>(
|
|
|
327
328
|
export declare function decorateColumnSettings<valueType>(settings: FieldOptions<unknown, valueType>, remult: Remult): FieldOptions<unknown, valueType>;
|
|
328
329
|
export declare class EntityBase {
|
|
329
330
|
get _(): EntityRefForEntityBase<this>;
|
|
330
|
-
save(): Promise<this>;
|
|
331
|
+
save(options?: InsertOrUpdateOptions): Promise<this>;
|
|
331
332
|
assign(values: Partial<Omit<this, keyof EntityBase>>): this;
|
|
332
333
|
delete(): Promise<void>;
|
|
333
334
|
isNew(): boolean;
|