remult 0.26.21 → 0.26.23-next.0
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/SseSubscriptionServer.d.ts +3 -4
- package/assign.js +1 -2
- package/esm/graphql.js +1 -1
- package/esm/remult-hono.js +3 -1
- package/esm/remult-knex/index.js +3 -1
- package/esm/remult-sqlite3.js +4 -1
- package/esm/remult-sveltekit.js +1 -0
- package/esm/server/index.js +3 -2
- package/esm/server/initAsyncHooks.js +3 -3
- package/esm/server/remult-admin.js +1 -4
- package/esm/server/remult-api-server.js +47 -48
- package/esm/src/CompoundIdField.js +9 -9
- package/esm/src/data-api.js +1 -1
- package/esm/src/data-providers/json-entity-opfs-storage.js +9 -5
- package/esm/src/data-providers/sql-database.js +9 -9
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +3 -1
- package/esm/src/live-query/LiveQueryClient.js +0 -1
- package/esm/src/remult-proxy.js +1 -3
- package/esm/src/remult-static.js +1 -0
- package/esm/src/remult3/Fields.js +4 -3
- package/esm/src/remult3/RepositoryImplementation.js +143 -104
- package/esm/src/remult3/entity.js +1 -1
- package/esm/src/remult3/relation-loader.js +2 -2
- package/esm/src/remult3/remult3.js +9 -0
- package/esm/src/server-action.js +16 -12
- package/esm/src/sort.js +0 -2
- package/esm/src/validators.js +3 -3
- package/esm/src/valueConverters.js +2 -2
- package/graphql.js +3 -4
- package/index.js +2 -2
- package/live-query/data-provider-live-query-storage.js +6 -6
- package/migrations/compare-migration-snapshots.js +48 -49
- package/migrations/generate-migrations.js +1 -2
- package/migrations/migrate.js +2 -3
- package/migrations/migration-types.d.ts +1 -1
- package/migrations/migration-types.js +4 -4
- package/migrations/update-migrations-ts-file.js +1 -2
- package/myLog.js +1 -2
- package/package.json +1 -1
- package/postgres/postgres-data-provider.d.ts +2 -2
- package/postgres/postgres-data-provider.js +5 -5
- package/postgres/schema-builder.js +3 -3
- package/remult-express.js +4 -3
- package/remult-fastify.js +4 -3
- package/remult-fresh.js +1 -2
- package/remult-hapi.js +4 -3
- package/remult-hono.js +6 -3
- package/remult-knex/index.d.ts +1 -1
- package/remult-knex/index.js +7 -5
- package/remult-mongo.d.ts +1 -1
- package/remult-next.d.ts +4 -5
- package/remult-next.js +11 -6
- package/remult-nuxt.js +1 -2
- package/remult-solid-start.js +1 -2
- package/remult-sqlite3.js +4 -1
- package/remult-sveltekit.js +33 -35
- package/server/JsonEntityFileStorage.d.ts +1 -1
- package/server/get-remult-admin-html.js +1 -2
- package/server/index.d.ts +1 -1
- package/server/index.js +4 -3
- package/server/initAsyncHooks.d.ts +10 -10
- package/server/initAsyncHooks.js +5 -2
- package/server/initDataProvider.js +1 -2
- package/server/initDataProviderOrJson.js +1 -2
- package/server/remult-admin.js +3 -7
- package/server/remult-api-server.d.ts +22 -22
- package/server/remult-api-server.js +54 -48
- package/src/CompoundIdField.d.ts +1 -1
- package/src/CompoundIdField.js +9 -0
- package/src/buildRestDataProvider.d.ts +1 -1
- package/src/buildRestDataProvider.js +8 -8
- package/src/column-interfaces.d.ts +8 -8
- package/src/column-interfaces.js +1 -2
- package/src/column.d.ts +4 -4
- package/src/column.js +2 -2
- package/src/context.d.ts +4 -4
- package/src/context.js +5 -5
- package/src/data-api.d.ts +2 -2
- package/src/data-api.js +4 -4
- package/src/data-interfaces.js +1 -2
- package/src/data-providers/json-entity-opfs-storage.js +30 -16
- package/src/data-providers/rest-data-provider.d.ts +3 -3
- package/src/data-providers/rest-data-provider.js +4 -4
- package/src/data-providers/sql-database.js +11 -11
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +3 -3
- package/src/filter/filter-consumer-bridge-to-sql-request.js +21 -19
- package/src/filter/filter-interfaces.d.ts +1 -1
- package/src/filter/filter-interfaces.js +10 -6
- package/src/isOfType.js +2 -3
- package/src/live-query/SubscriptionServer.js +95 -97
- package/src/remult-proxy.js +1 -3
- package/src/remult-static.d.ts +2 -2
- package/src/remult-static.js +7 -4
- package/src/remult3/Fields.d.ts +2 -2
- package/src/remult3/Fields.js +11 -9
- package/src/remult3/RepositoryImplementation.d.ts +41 -39
- package/src/remult3/RepositoryImplementation.js +416 -365
- package/src/remult3/__updateEntityBasedOnWhere.js +1 -2
- package/src/remult3/addValidator.d.ts +1 -1
- package/src/remult3/addValidator.js +1 -2
- package/src/remult3/classDescribers.d.ts +3 -3
- package/src/remult3/classDescribers.js +3 -4
- package/src/remult3/entity.js +2 -4
- package/src/remult3/getEntityRef.js +4 -4
- package/src/remult3/relation-loader.d.ts +1 -1
- package/src/remult3/relationInfoMember.d.ts +2 -2
- package/src/remult3/relationInfoMember.js +4 -5
- package/src/remult3/remult3.d.ts +13 -10
- package/src/remult3/remult3.js +9 -0
- package/src/remult3/repository-internals.d.ts +3 -3
- package/src/remult3/repository-internals.js +2 -2
- package/src/server-action.d.ts +1 -1
- package/src/server-action.js +65 -58
- package/src/sort.d.ts +1 -1
- package/src/sort.js +0 -2
- package/src/sql-command.d.ts +1 -1
- package/src/validators.d.ts +1 -1
- package/src/validators.js +13 -11
- package/src/valueConverters.js +3 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.__updateEntityBasedOnWhere =
|
|
3
|
+
exports.__updateEntityBasedOnWhere = __updateEntityBasedOnWhere;
|
|
4
4
|
var filter_interfaces_js_1 = require("../filter/filter-interfaces.js");
|
|
5
5
|
function __updateEntityBasedOnWhere(entityDefs, where, r) {
|
|
6
6
|
var w = filter_interfaces_js_1.Filter.fromEntityFilter(entityDefs, where);
|
|
@@ -29,4 +29,3 @@ function __updateEntityBasedOnWhere(entityDefs, where, r) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
exports.__updateEntityBasedOnWhere = __updateEntityBasedOnWhere;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FieldOptions } from '../column-interfaces.js';
|
|
2
|
-
export declare function addValidator(validators: FieldOptions['validate'], newValidator: FieldOptions['validate'], atStart?: boolean): import("../column-interfaces.js").FieldValidator<any, any> | import("../column-interfaces.js").FieldValidator<any, any>[];
|
|
2
|
+
export declare function addValidator(validators: FieldOptions['validate'], newValidator: FieldOptions['validate'], atStart?: boolean): import("../column-interfaces.js").FieldValidator<any, any> | import("../column-interfaces.js").FieldValidator<any, any>[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addValidator =
|
|
3
|
+
exports.addValidator = addValidator;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
function addValidator(validators, newValidator, atStart) {
|
|
6
6
|
if (atStart === void 0) { atStart = false; }
|
|
@@ -17,4 +17,3 @@ function addValidator(validators, newValidator, atStart) {
|
|
|
17
17
|
return atStart
|
|
18
18
|
? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(newValidators), false), tslib_1.__read(validatorsArray), false) : tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(validatorsArray), false), tslib_1.__read(newValidators), false);
|
|
19
19
|
}
|
|
20
|
-
exports.addValidator = addValidator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClassType } from '../../classType.js';
|
|
2
|
-
import { EntityOptions } from '../entity.js';
|
|
3
|
-
import { BackendMethodOptions } from '../server-action.js';
|
|
1
|
+
import type { ClassType } from '../../classType.js';
|
|
2
|
+
import type { EntityOptions } from '../entity.js';
|
|
3
|
+
import { type BackendMethodOptions } from '../server-action.js';
|
|
4
4
|
type Descriptor<T = any> = (a: T, b: string, c?: any) => void;
|
|
5
5
|
type FieldsDescriptor<T> = T extends new (...args: any[]) => infer R ? {
|
|
6
6
|
[K in keyof R]?: Descriptor;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.describeClass = describeClass;
|
|
4
|
+
exports.describeBackendMethods = describeBackendMethods;
|
|
5
|
+
exports.describeEntity = describeEntity;
|
|
4
6
|
var server_action_js_1 = require("../server-action.js");
|
|
5
7
|
var entity_js_1 = require("./entity.js");
|
|
6
8
|
function describeClass(classType, classDescriber, members, staticMembers) {
|
|
@@ -23,7 +25,6 @@ function describeClass(classType, classDescriber, members, staticMembers) {
|
|
|
23
25
|
Object.defineProperty(classType, staticFieldKey, prop);
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
|
-
exports.describeClass = describeClass;
|
|
27
28
|
function describeBackendMethods(classType, backendMethods) {
|
|
28
29
|
var result = {};
|
|
29
30
|
for (var key in backendMethods) {
|
|
@@ -34,8 +35,6 @@ function describeBackendMethods(classType, backendMethods) {
|
|
|
34
35
|
}
|
|
35
36
|
describeClass(classType, undefined, undefined, result);
|
|
36
37
|
}
|
|
37
|
-
exports.describeBackendMethods = describeBackendMethods;
|
|
38
38
|
function describeEntity(classType, key, fields, options) {
|
|
39
39
|
describeClass(classType, (0, entity_js_1.Entity)(key, options), fields);
|
|
40
40
|
}
|
|
41
|
-
exports.describeEntity = describeEntity;
|
package/src/remult3/entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Entity =
|
|
3
|
+
exports.Entity = Entity;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var context_js_1 = require("../context.js");
|
|
6
6
|
var getEntityRef_js_1 = require("./getEntityRef.js");
|
|
@@ -35,11 +35,10 @@ function Entity(key) {
|
|
|
35
35
|
options[_i - 1] = arguments[_i];
|
|
36
36
|
}
|
|
37
37
|
return function (target, info) {
|
|
38
|
-
var _a;
|
|
39
38
|
for (var rawFilterMember in target) {
|
|
40
39
|
if (Object.prototype.hasOwnProperty.call(target, rawFilterMember)) {
|
|
41
40
|
var element = target[rawFilterMember];
|
|
42
|
-
if (
|
|
41
|
+
if (element === null || element === void 0 ? void 0 : element.rawFilterInfo) {
|
|
43
42
|
if (!element.rawFilterInfo.key)
|
|
44
43
|
element.rawFilterInfo.key = rawFilterMember;
|
|
45
44
|
}
|
|
@@ -85,4 +84,3 @@ function Entity(key) {
|
|
|
85
84
|
return target;
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
|
-
exports.Entity = Entity;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.entityInfo_key = exports.entityInfo = exports.entityMember = void 0;
|
|
4
|
+
exports.getEntityRef = getEntityRef;
|
|
5
|
+
exports.getEntitySettings = getEntitySettings;
|
|
6
|
+
exports.getEntityKey = getEntityKey;
|
|
4
7
|
/**
|
|
5
8
|
* Retrieves the EntityRef object associated with the specified entity instance.
|
|
6
9
|
* The EntityRef provides methods for performing operations on the entity instance.
|
|
@@ -20,7 +23,6 @@ function getEntityRef(entity, throwException) {
|
|
|
20
23
|
' was not initialized using a context');
|
|
21
24
|
return x;
|
|
22
25
|
}
|
|
23
|
-
exports.getEntityRef = getEntityRef;
|
|
24
26
|
exports.entityMember = Symbol.for('entityMember');
|
|
25
27
|
exports.entityInfo = Symbol.for('entityInfo');
|
|
26
28
|
exports.entityInfo_key = Symbol.for('entityInfo_key');
|
|
@@ -38,8 +40,6 @@ function getEntitySettings(entity, throwError) {
|
|
|
38
40
|
" is not a known entity, did you forget to set @Entity() or did you forget to add the '@' before the call to Entity?");
|
|
39
41
|
return info;
|
|
40
42
|
}
|
|
41
|
-
exports.getEntitySettings = getEntitySettings;
|
|
42
43
|
function getEntityKey(entity) {
|
|
43
44
|
return entity[exports.entityInfo_key];
|
|
44
45
|
}
|
|
45
|
-
exports.getEntityKey = getEntityKey;
|
|
@@ -2,7 +2,7 @@ import type { RelationLoaderHelper } from './relation-loader-types.js';
|
|
|
2
2
|
import type { FindOptions } from './remult3.js';
|
|
3
3
|
export declare class RelationLoader {
|
|
4
4
|
entityLoaders: Map<any, EntityLoader>;
|
|
5
|
-
promises: any[];
|
|
5
|
+
promises: Promise<any>[];
|
|
6
6
|
load(rel: RelationLoaderHelper<any>, findOptions: FindOptions<any>): Promise<any[]>;
|
|
7
7
|
constructor();
|
|
8
8
|
resolveAll(): Promise<void>;
|
|
@@ -3,7 +3,7 @@ import type { FieldMetadata, FieldOptions } from '../column-interfaces.js';
|
|
|
3
3
|
import type { Remult } from '../context.js';
|
|
4
4
|
import type { DataProvider } from '../data-interfaces.js';
|
|
5
5
|
import type { RelationOptions, Repository } from './remult3.js';
|
|
6
|
-
export declare function relationInfoMemberInOptions(toEntityType: () => ClassType<any>, type: RelationFieldInfo['type']): FieldOptions
|
|
6
|
+
export declare function relationInfoMemberInOptions(toEntityType: () => ClassType<any>, type: RelationFieldInfo['type']): FieldOptions;
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated
|
|
9
9
|
*/
|
|
@@ -15,7 +15,7 @@ export interface RelationInfo {
|
|
|
15
15
|
toType: () => any;
|
|
16
16
|
type: RelationFieldInfo['type'];
|
|
17
17
|
}
|
|
18
|
-
export declare function getRelationFieldInfo(field: FieldMetadata): RelationFieldInfo;
|
|
18
|
+
export declare function getRelationFieldInfo(field: FieldMetadata<unknown, unknown>): RelationFieldInfo | undefined;
|
|
19
19
|
export interface RelationFieldInfo {
|
|
20
20
|
type: 'reference' | 'toOne' | 'toMany';
|
|
21
21
|
options: RelationOptions<any, any, any>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.relationInfoMemberInOptions = relationInfoMemberInOptions;
|
|
4
|
+
exports.getRelationInfo = getRelationInfo;
|
|
5
|
+
exports.getRelationFieldInfo = getRelationFieldInfo;
|
|
6
|
+
exports.verifyFieldRelationInfo = verifyFieldRelationInfo;
|
|
4
7
|
var tslib_1 = require("tslib");
|
|
5
8
|
var CompoundIdField_js_1 = require("../CompoundIdField.js");
|
|
6
9
|
function relationInfoMemberInOptions(toEntityType, type) {
|
|
@@ -12,7 +15,6 @@ function relationInfoMemberInOptions(toEntityType, type) {
|
|
|
12
15
|
},
|
|
13
16
|
_a;
|
|
14
17
|
}
|
|
15
|
-
exports.relationInfoMemberInOptions = relationInfoMemberInOptions;
|
|
16
18
|
var relationInfoMember = Symbol.for('relationInfo');
|
|
17
19
|
/**
|
|
18
20
|
* @deprecated
|
|
@@ -20,12 +22,10 @@ var relationInfoMember = Symbol.for('relationInfo');
|
|
|
20
22
|
function getRelationInfo(options) {
|
|
21
23
|
return options === null || options === void 0 ? void 0 : options[relationInfoMember];
|
|
22
24
|
}
|
|
23
|
-
exports.getRelationInfo = getRelationInfo;
|
|
24
25
|
var fieldRelationInfo = Symbol.for('fieldRelationInfo');
|
|
25
26
|
function getRelationFieldInfo(field) {
|
|
26
27
|
return field[fieldRelationInfo];
|
|
27
28
|
}
|
|
28
|
-
exports.getRelationFieldInfo = getRelationFieldInfo;
|
|
29
29
|
function verifyFieldRelationInfo(repo, remult, dp) {
|
|
30
30
|
var e_1, _a;
|
|
31
31
|
var _loop_1 = function (field) {
|
|
@@ -147,4 +147,3 @@ function verifyFieldRelationInfo(repo, remult, dp) {
|
|
|
147
147
|
finally { if (e_1) throw e_1.error; }
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
exports.verifyFieldRelationInfo = verifyFieldRelationInfo;
|
package/src/remult3/remult3.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ import type { SortSegment } from '../sort.js';
|
|
|
8
8
|
import type { EntityBase } from './RepositoryImplementation.js';
|
|
9
9
|
export interface EntityRefBase<entityType> extends Subscribable {
|
|
10
10
|
hasErrors(): boolean;
|
|
11
|
-
undoChanges():
|
|
11
|
+
undoChanges(): void;
|
|
12
12
|
save(): Promise<entityType>;
|
|
13
13
|
reload(): Promise<entityType>;
|
|
14
14
|
delete(): Promise<void>;
|
|
15
15
|
isNew(): boolean;
|
|
16
16
|
wasChanged(): boolean;
|
|
17
17
|
wasDeleted(): boolean;
|
|
18
|
-
error: string;
|
|
18
|
+
error: string | undefined;
|
|
19
19
|
getId(): idType<entityType>;
|
|
20
20
|
getOriginalId(): idType<entityType>;
|
|
21
21
|
repository: Repository<entityType>;
|
|
@@ -37,7 +37,7 @@ export interface EntityRefForEntityBase<entityType> extends EntityRefBase<entity
|
|
|
37
37
|
relations: RepositoryRelationsForEntityBase<entityType>;
|
|
38
38
|
}
|
|
39
39
|
export interface ValidateFieldEvent<entityType = any, valueType = any> {
|
|
40
|
-
error
|
|
40
|
+
error?: string;
|
|
41
41
|
value: valueType;
|
|
42
42
|
originalValue: valueType;
|
|
43
43
|
valueChanged(): boolean;
|
|
@@ -95,7 +95,7 @@ export interface LifecycleEvent<entityType> {
|
|
|
95
95
|
}
|
|
96
96
|
export interface ControllerRefBase<entityType> extends Subscribable {
|
|
97
97
|
hasErrors(): boolean;
|
|
98
|
-
error: string;
|
|
98
|
+
error: string | undefined;
|
|
99
99
|
validate(): Promise<ErrorInfo<entityType> | undefined>;
|
|
100
100
|
readonly isLoading: boolean;
|
|
101
101
|
}
|
|
@@ -145,7 +145,7 @@ export interface IdFieldRef<entityType, valueType> extends FieldRef<entityType,
|
|
|
145
145
|
id?: number;
|
|
146
146
|
} ? number : valueType extends {
|
|
147
147
|
id?: string;
|
|
148
|
-
} ? string : string | number):
|
|
148
|
+
} ? string : string | number): void;
|
|
149
149
|
getId(): valueType extends {
|
|
150
150
|
id?: number;
|
|
151
151
|
} ? number : valueType extends {
|
|
@@ -153,7 +153,7 @@ export interface IdFieldRef<entityType, valueType> extends FieldRef<entityType,
|
|
|
153
153
|
} ? string : string | number;
|
|
154
154
|
}
|
|
155
155
|
export interface FieldRef<entityType = any, valueType = any> extends Subscribable {
|
|
156
|
-
error: string;
|
|
156
|
+
error: string | undefined;
|
|
157
157
|
displayValue: string;
|
|
158
158
|
value: valueType;
|
|
159
159
|
originalValue: valueType;
|
|
@@ -162,6 +162,9 @@ export interface FieldRef<entityType = any, valueType = any> extends Subscribabl
|
|
|
162
162
|
entityRef: EntityRef<entityType>;
|
|
163
163
|
container: entityType;
|
|
164
164
|
metadata: FieldMetadata<valueType>;
|
|
165
|
+
/**
|
|
166
|
+
* Loads the related value - returns null if the related value is not found
|
|
167
|
+
*/
|
|
165
168
|
load(): Promise<valueType>;
|
|
166
169
|
valueIsNull(): boolean;
|
|
167
170
|
originalValueIsNull(): boolean;
|
|
@@ -265,16 +268,16 @@ export interface Repository<entityType> {
|
|
|
265
268
|
* @example
|
|
266
269
|
* await taskRepo.findFirst({ completed:false },{ createIfNotFound: true })
|
|
267
270
|
* */
|
|
268
|
-
findFirst(where?: EntityFilter<entityType>, options?: FindFirstOptions<entityType>): Promise<entityType>;
|
|
271
|
+
findFirst(where?: EntityFilter<entityType>, options?: FindFirstOptions<entityType>): Promise<entityType | undefined>;
|
|
269
272
|
/** returns the first item that matchers the `where` condition
|
|
270
273
|
* @example
|
|
271
274
|
* await taskRepo.findOne({ where:{ completed:false }})
|
|
272
275
|
* @example
|
|
273
276
|
* await taskRepo.findFirst({ where:{ completed:false }, createIfNotFound: true })
|
|
274
277
|
* */
|
|
275
|
-
findOne(options?: FindFirstOptions<entityType>): Promise<entityType>;
|
|
276
|
-
/** returns the items that matches the
|
|
277
|
-
findId(id: idType<entityType>, options?: FindFirstOptionsBase<entityType>): Promise<entityType>;
|
|
278
|
+
findOne(options?: FindFirstOptions<entityType>): Promise<entityType | undefined>;
|
|
279
|
+
/** returns the items that matches the id. If id is undefined | null, returns null */
|
|
280
|
+
findId(id: idType<entityType>, options?: FindFirstOptionsBase<entityType>): Promise<entityType | undefined | null>;
|
|
278
281
|
/** An alternative form of fetching data from the API server, which is intended for operating on large numbers of entity objects.
|
|
279
282
|
*
|
|
280
283
|
* It also has it's own paging mechanism that can be used n paging scenarios.
|
package/src/remult3/remult3.js
CHANGED
|
@@ -4,8 +4,16 @@ exports.flags = void 0;
|
|
|
4
4
|
exports.flags = {
|
|
5
5
|
error500RetryCount: 4,
|
|
6
6
|
};
|
|
7
|
+
/*y1 - typing discussion:
|
|
8
|
+
* all fields required in fields
|
|
9
|
+
* key as key of entity
|
|
10
|
+
* continue with?
|
|
11
|
+
* should and / or accept also undefined members? the code supports it, not sure if the api should
|
|
12
|
+
* Sql server expression supports undefined as a response
|
|
13
|
+
*/
|
|
7
14
|
//p1 - fix query docs to also explain how it can be used for infinite scroll and pagination.
|
|
8
15
|
//y1 - 'test expression columns without aliases'
|
|
16
|
+
//y1 - ts issue with fields - when a field is optional, it's $ is also optional and thats a problem
|
|
9
17
|
//p1 - see if I can fix the no alias problem in selects
|
|
10
18
|
//p1 - add luid - it's cool for order by.
|
|
11
19
|
//p1 - replace uuid with crypto.randomUUID and allow custom fallback
|
|
@@ -54,6 +62,7 @@ const result = await repo.batch(x=>({
|
|
|
54
62
|
//p1 - article on displayValue including it's definition for entities that is used in relations
|
|
55
63
|
//p1 - article auth.js with express - played with it, requires type="module" and a few more configurations - https://github.com/noam-honig/express-auth
|
|
56
64
|
//p2 - fix remult admin not to load the html into memory until used
|
|
65
|
+
//p2 - add update to entityRef and EntityBase
|
|
57
66
|
//y2 - currently for string fields we default for 255 in knex (which is their default) why not just use text (varchar max) - and only use exact length when one is provided?
|
|
58
67
|
//p2 - create foreign key constraints in user code - https://codesandbox.io/p/devbox/fk-validator-tdshcs
|
|
59
68
|
//p2 - admin url1 - pocketbase use /_ for the admin //{allowed?:Allowed,url?:string} also checkout the admin* as it should probably be something else and didn't work in hono
|
|
@@ -7,9 +7,9 @@ export interface RepositoryInternal<entityType> {
|
|
|
7
7
|
_fromJsonArray(jsonItems: any[], loadOptions: LoadOptions<entityType>): Promise<entityType[]>;
|
|
8
8
|
_buildEntityDataProviderFindOptions(options: FindOptions<entityType>): Promise<EntityDataProviderFindOptions>;
|
|
9
9
|
_translateWhereToFilter(where: EntityFilter<entityType>): Promise<Filter>;
|
|
10
|
-
_getCachedById(id: any, doNotLoadIfNotFound: boolean): entityType;
|
|
11
|
-
_getCachedByIdAsync(id: any, doNotLoadIfNotFound: boolean): Promise<entityType>;
|
|
12
|
-
_addToCache(item: entityType):
|
|
10
|
+
_getCachedById(id: any, doNotLoadIfNotFound: boolean): entityType | undefined;
|
|
11
|
+
_getCachedByIdAsync(id: any, doNotLoadIfNotFound: boolean): Promise<entityType | undefined>;
|
|
12
|
+
_addToCache(item: entityType): void;
|
|
13
13
|
_getFocusedRelationRepo(field: FieldMetadata, item: any): {
|
|
14
14
|
toRepo: Repository<any>;
|
|
15
15
|
returnNull: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInternalKey =
|
|
3
|
+
exports.getInternalKey = void 0;
|
|
4
|
+
exports.getRepositoryInternals = getRepositoryInternals;
|
|
4
5
|
function getRepositoryInternals(repo) {
|
|
5
6
|
var x = repo;
|
|
6
7
|
if (typeof x[exports.getInternalKey] === 'function')
|
|
7
8
|
return x[exports.getInternalKey]();
|
|
8
9
|
throw Error('Error getting repository internal from ' + repo);
|
|
9
10
|
}
|
|
10
|
-
exports.getRepositoryInternals = getRepositoryInternals;
|
|
11
11
|
exports.getInternalKey = Symbol.for('getInternal');
|
package/src/server-action.d.ts
CHANGED
|
@@ -74,6 +74,6 @@ export declare function prepareReceivedArgs(types: any[], args: any[], remult: R
|
|
|
74
74
|
export declare const classBackendMethodsArray: unique symbol;
|
|
75
75
|
export interface ActionInterface {
|
|
76
76
|
doWork: (args: any[], self: any, baseUrl?: string, http?: RestDataProviderHttpProvider) => Promise<any>;
|
|
77
|
-
__register(reg: (url: string, queue: boolean, allowed: AllowedForInstance<any>, what: (data: any, req: Remult, res: DataApiResponse) => void) => void):
|
|
77
|
+
__register(reg: (url: string, queue: boolean, allowed: AllowedForInstance<any>, what: (data: any, req: Remult, res: DataApiResponse) => void) => void): void;
|
|
78
78
|
}
|
|
79
79
|
export {};
|