remult 0.24.0 → 0.24.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.
Files changed (82) hide show
  1. package/esm/src/data-providers/json-data-provider.js +8 -8
  2. package/esm/src/remult3/remult3.js +7 -20
  3. package/package.json +1 -1
  4. package/src/data-providers/json-data-provider.d.ts +2 -2
  5. package/src/data-providers/json-data-provider.js +39 -16
  6. package/src/remult3/remult3.d.ts +0 -20
  7. package/src/remult3/remult3.js +7 -20
  8. package/esm/SseSubscriptionServer.d.ts +0 -25
  9. package/esm/ably.d.ts +0 -13
  10. package/esm/assign.d.ts +0 -1
  11. package/esm/classType.d.ts +0 -3
  12. package/esm/graphql.d.ts +0 -14
  13. package/esm/index.d.ts +0 -46
  14. package/esm/inputTypes.d.ts +0 -9
  15. package/esm/internals.d.ts +0 -7
  16. package/esm/live-query/data-provider-live-query-storage.d.ts +0 -23
  17. package/esm/myLog.d.ts +0 -1
  18. package/esm/postgres/index.d.ts +0 -2
  19. package/esm/postgres/postgres-data-provider.d.ts +0 -36
  20. package/esm/postgres/schema-builder.d.ts +0 -20
  21. package/esm/remult-express.d.ts +0 -9
  22. package/esm/remult-fastify.d.ts +0 -6
  23. package/esm/remult-fresh.d.ts +0 -17
  24. package/esm/remult-hapi.d.ts +0 -6
  25. package/esm/remult-knex/index.d.ts +0 -30
  26. package/esm/remult-mongo.d.ts +0 -24
  27. package/esm/remult-next.d.ts +0 -25
  28. package/esm/remult-sveltekit.d.ts +0 -6
  29. package/esm/server/JsonEntityFileStorage.d.ts +0 -11
  30. package/esm/server/core.d.ts +0 -4
  31. package/esm/server/expressBridge.d.ts +0 -136
  32. package/esm/server/index.d.ts +0 -6
  33. package/esm/server/initAsyncHooks.d.ts +0 -1
  34. package/esm/server/initDataProvider.d.ts +0 -2
  35. package/esm/src/CompoundIdField.d.ts +0 -27
  36. package/esm/src/__EntityValueProvider.d.ts +0 -11
  37. package/esm/src/__RowsOfDataForTesting.d.ts +0 -3
  38. package/esm/src/buildRestDataProvider.d.ts +0 -30
  39. package/esm/src/column-interfaces.d.ts +0 -172
  40. package/esm/src/column.d.ts +0 -19
  41. package/esm/src/context.d.ts +0 -134
  42. package/esm/src/data-api.d.ts +0 -39
  43. package/esm/src/data-interfaces.d.ts +0 -41
  44. package/esm/src/data-providers/array-entity-data-provider.d.ts +0 -4
  45. package/esm/src/data-providers/in-memory-database.d.ts +0 -9
  46. package/esm/src/data-providers/json-data-provider.d.ts +0 -12
  47. package/esm/src/data-providers/rest-data-provider.d.ts +0 -39
  48. package/esm/src/data-providers/sql-database.d.ts +0 -33
  49. package/esm/src/data-providers/web-sql-data-provider.d.ts +0 -21
  50. package/esm/src/entity.d.ts +0 -126
  51. package/esm/src/filter/filter-consumer-bridge-to-sql-request.d.ts +0 -51
  52. package/esm/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -0
  53. package/esm/src/filter/filter-consumer-bridge-to-url-builder.js +0 -0
  54. package/esm/src/filter/filter-interfaces.d.ts +0 -74
  55. package/esm/src/live-query/LiveQueryClient.d.ts +0 -1
  56. package/esm/src/live-query/SseSubscriptionClient.d.ts +0 -5
  57. package/esm/src/live-query/SubscriptionChannel.d.ts +0 -41
  58. package/esm/src/live-query/SubscriptionServer.d.ts +0 -38
  59. package/esm/src/remult-proxy.d.ts +0 -2
  60. package/esm/src/remult3/DecoratorReplacer.d.ts +0 -9
  61. package/esm/src/remult3/Fields.d.ts +0 -133
  62. package/esm/src/remult3/IdEntity.d.ts +0 -4
  63. package/esm/src/remult3/RepositoryImplementation.d.ts +0 -289
  64. package/esm/src/remult3/__updateEntityBasedOnWhere.d.ts +0 -2
  65. package/esm/src/remult3/columnInfo.d.ts +0 -6
  66. package/esm/src/remult3/entity.d.ts +0 -28
  67. package/esm/src/remult3/getEntityRef.d.ts +0 -9
  68. package/esm/src/remult3/relation-loader-types.d.ts +0 -7
  69. package/esm/src/remult3/relation-loader.d.ts +0 -40
  70. package/esm/src/remult3/relationInfoMember.d.ts +0 -4
  71. package/esm/src/remult3/remult3.d.ts +0 -604
  72. package/esm/src/remult3/repository-internals.d.ts +0 -14
  73. package/esm/src/resultCompoundIdFilter.d.ts +0 -3
  74. package/esm/src/server-action-info.d.ts +0 -10
  75. package/esm/src/server-action.d.ts +0 -79
  76. package/esm/src/sort.d.ts +0 -16
  77. package/esm/src/sql-command.d.ts +0 -19
  78. package/esm/src/validators.d.ts +0 -14
  79. package/esm/src/valueConverters.d.ts +0 -13
  80. package/esm/urlBuilder.d.ts +0 -6
  81. package/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -0
  82. package/src/filter/filter-consumer-bridge-to-url-builder.js +0 -0
@@ -1,79 +0,0 @@
1
- import 'reflect-metadata';
2
- import type { AllowedForInstance } from './context';
3
- import { Remult } from './context';
4
- import type { DataApiResponse } from './data-api';
5
- import type { DataProvider, RestDataProviderHttpProvider } from './data-interfaces';
6
- interface inArgs {
7
- args: any[];
8
- }
9
- interface result {
10
- data: any;
11
- }
12
- export declare abstract class Action<inParam, outParam> implements ActionInterface {
13
- private actionUrl;
14
- private queue;
15
- private allowed;
16
- constructor(actionUrl: string, queue: boolean, allowed: AllowedForInstance<any>);
17
- static apiUrlForJobStatus: string;
18
- run(pIn: inParam, baseUrl?: string, http?: RestDataProviderHttpProvider): Promise<outParam>;
19
- doWork: (args: any[], self: any, baseUrl?: string, http?: RestDataProviderHttpProvider) => Promise<any>;
20
- protected abstract execute(info: inParam, req: Remult, res: DataApiResponse): Promise<outParam>;
21
- __register(reg: (url: string, queue: boolean, allowed: AllowedForInstance<any>, what: (data: any, req: Remult, res: DataApiResponse) => void) => void): void;
22
- }
23
- export declare class ForbiddenError extends Error {
24
- constructor();
25
- isForbiddenError: true;
26
- }
27
- export declare class myServerAction extends Action<inArgs, result> {
28
- private types;
29
- private options;
30
- originalMethod: (args: any[]) => any;
31
- constructor(name: string, types: any[], options: BackendMethodOptions<any>, originalMethod: (args: any[]) => any);
32
- protected execute(info: inArgs, remult: Remult, res: DataApiResponse): Promise<result>;
33
- }
34
- export interface BackendMethodOptions<type> {
35
- /**Determines when this `BackendMethod` can execute, see: [Allowed](https://remult.dev/docs/allowed.html) */
36
- allowed: AllowedForInstance<type>;
37
- /** Used to determine the route for the BackendMethod.
38
- * @example
39
- * {allowed:true, apiPrefix:'someFolder/'}
40
- */
41
- apiPrefix?: string;
42
- /** EXPERIMENTAL: Determines if this method should be queued for later execution */
43
- queue?: boolean;
44
- /** EXPERIMENTAL: Determines if the user should be blocked while this `BackendMethod` is running*/
45
- blockUser?: boolean;
46
- paramTypes?: any[];
47
- }
48
- export declare function Controller(key: string): (target: any, context?: any) => any;
49
- export interface ClassMethodDecoratorContextStub<This = unknown, Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any> {
50
- readonly kind: 'method';
51
- readonly name: string | symbol;
52
- readonly access: {
53
- has(object: This): boolean;
54
- };
55
- }
56
- /** Indicates that the decorated methods runs on the backend. See: [Backend Methods](https://remult.dev/docs/backendMethods.html) */
57
- export declare function BackendMethod<type = any>(options: BackendMethodOptions<type>): (target: any, context: ClassMethodDecoratorContextStub<type> | string, descriptor?: any) => any;
58
- export interface jobWasQueuedResult {
59
- queuedJobId?: string;
60
- }
61
- export interface queuedJobInfoResponse {
62
- done: boolean;
63
- result?: any;
64
- error?: any;
65
- progress?: number;
66
- }
67
- export declare class ProgressListener {
68
- private res;
69
- constructor(res: DataApiResponse);
70
- progress(progress: number): void;
71
- }
72
- export declare function prepareArgsToSend(types: any[], args: any[]): any[];
73
- export declare function prepareReceivedArgs(types: any[], args: any[], remult: Remult, ds: DataProvider, res: DataApiResponse): Promise<any[]>;
74
- export declare const classBackendMethodsArray: unique symbol;
75
- export interface ActionInterface {
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): any;
78
- }
79
- export {};
package/esm/src/sort.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { FieldMetadata } from './column-interfaces';
2
- import type { EntityMetadata, EntityOrderBy } from './remult3/remult3';
3
- export declare class Sort {
4
- toEntityOrderBy(): EntityOrderBy<any>;
5
- constructor(...segments: SortSegment[]);
6
- Segments: SortSegment[];
7
- reverse(): Sort;
8
- compare(a: any, b: any, getFieldKey?: (field: FieldMetadata) => string): number;
9
- static translateOrderByToSort<T>(entityDefs: EntityMetadata<T>, orderBy?: EntityOrderBy<T>): Sort;
10
- static createUniqueSort<T>(entityMetadata: EntityMetadata<T>, orderBy?: Sort): Sort;
11
- static createUniqueEntityOrderBy<T>(entityMetadata: EntityMetadata<T>, orderBy?: EntityOrderBy<T>): EntityOrderBy<T>;
12
- }
13
- export interface SortSegment {
14
- field: FieldMetadata;
15
- isDescending?: boolean;
16
- }
@@ -1,19 +0,0 @@
1
- import type { EntityMetadata } from './remult3/remult3';
2
- export interface SqlImplementation {
3
- getLimitSqlSyntax(limit: number, offset: number): any;
4
- createCommand(): SqlCommand;
5
- transaction(action: (sql: SqlImplementation) => Promise<void>): Promise<void>;
6
- entityIsUsedForTheFirstTime(entity: EntityMetadata): Promise<void>;
7
- ensureSchema?(entities: EntityMetadata[]): Promise<void>;
8
- supportsJsonColumnType?: boolean;
9
- }
10
- export interface SqlCommand extends SqlCommandWithParameters {
11
- execute(sql: string): Promise<SqlResult>;
12
- }
13
- export interface SqlCommandWithParameters {
14
- addParameterAndReturnSqlToken(val: any): string;
15
- }
16
- export interface SqlResult {
17
- rows: any[];
18
- getColumnKeyInResultForIndexInSelect(index: number): string;
19
- }
@@ -1,14 +0,0 @@
1
- import type { FieldRef } from './remult3/remult3';
2
- export declare class Validators {
3
- static required: ((entity: any, col: FieldRef<any, string>, message?: any) => void) & {
4
- withMessage: (message: string) => (entity: any, col: FieldRef<any, string>) => void;
5
- defaultMessage: string;
6
- };
7
- static unique: ((entity: any, col: FieldRef<any, any>, message?: any) => Promise<void>) & {
8
- withMessage: (message: string) => (entity: any, col: FieldRef<any, any>) => Promise<void>;
9
- defaultMessage: string;
10
- };
11
- static uniqueOnBackend: ((entity: any, col: FieldRef<any, any>, message?: any) => Promise<void>) & {
12
- withMessage: (message: string) => (entity: any, col: FieldRef<any, any>) => Promise<void>;
13
- };
14
- }
@@ -1,13 +0,0 @@
1
- import type { ValueConverter } from './column-interfaces';
2
- export declare class ValueConverters {
3
- static readonly Date: ValueConverter<Date>;
4
- static readonly DateOnly: ValueConverter<Date>;
5
- static readonly DateOnlyString: ValueConverter<Date>;
6
- static readonly Boolean: ValueConverter<Boolean>;
7
- static readonly Number: ValueConverter<number>;
8
- static readonly String: ValueConverter<String>;
9
- static readonly Integer: ValueConverter<number>;
10
- static readonly Default: Required<ValueConverter<any>>;
11
- static readonly JsonString: ValueConverter<any>;
12
- static readonly JsonValue: ValueConverter<any>;
13
- }
@@ -1,6 +0,0 @@
1
- export declare class UrlBuilder {
2
- url: string;
3
- constructor(url: string);
4
- add(key: string, value: any): void;
5
- addObject(object: any, suffix?: string): void;
6
- }