remult 0.24.0-exp.5 → 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.
- package/esm/remult-nuxt.js +6 -4
- package/esm/src/data-providers/json-data-provider.js +8 -8
- package/esm/src/remult3/remult3.js +7 -20
- package/package.json +1 -1
- package/remult-nuxt.d.ts +1 -1
- package/remult-nuxt.js +4 -2
- package/src/data-providers/json-data-provider.d.ts +2 -2
- package/src/data-providers/json-data-provider.js +39 -16
- package/src/remult3/remult3.d.ts +0 -20
- package/src/remult3/remult3.js +7 -20
- package/esm/SseSubscriptionServer.d.ts +0 -25
- package/esm/ably.d.ts +0 -13
- package/esm/assign.d.ts +0 -1
- package/esm/classType.d.ts +0 -3
- package/esm/graphql.d.ts +0 -14
- package/esm/index.d.ts +0 -46
- package/esm/inputTypes.d.ts +0 -9
- package/esm/internals.d.ts +0 -7
- package/esm/live-query/data-provider-live-query-storage.d.ts +0 -23
- package/esm/myLog.d.ts +0 -1
- package/esm/postgres/index.d.ts +0 -2
- package/esm/postgres/postgres-data-provider.d.ts +0 -36
- package/esm/postgres/schema-builder.d.ts +0 -20
- package/esm/remult-express.d.ts +0 -9
- package/esm/remult-fastify.d.ts +0 -6
- package/esm/remult-fresh.d.ts +0 -17
- package/esm/remult-hapi.d.ts +0 -6
- package/esm/remult-knex/index.d.ts +0 -30
- package/esm/remult-mongo.d.ts +0 -24
- package/esm/remult-next.d.ts +0 -25
- package/esm/remult-sveltekit.d.ts +0 -6
- package/esm/server/JsonEntityFileStorage.d.ts +0 -11
- package/esm/server/core.d.ts +0 -4
- package/esm/server/expressBridge.d.ts +0 -136
- package/esm/server/index.d.ts +0 -6
- package/esm/server/initAsyncHooks.d.ts +0 -1
- package/esm/server/initDataProvider.d.ts +0 -2
- package/esm/src/CompoundIdField.d.ts +0 -27
- package/esm/src/__EntityValueProvider.d.ts +0 -11
- package/esm/src/__RowsOfDataForTesting.d.ts +0 -3
- package/esm/src/buildRestDataProvider.d.ts +0 -30
- package/esm/src/column-interfaces.d.ts +0 -172
- package/esm/src/column.d.ts +0 -19
- package/esm/src/context.d.ts +0 -134
- package/esm/src/data-api.d.ts +0 -39
- package/esm/src/data-interfaces.d.ts +0 -41
- package/esm/src/data-providers/array-entity-data-provider.d.ts +0 -4
- package/esm/src/data-providers/in-memory-database.d.ts +0 -9
- package/esm/src/data-providers/json-data-provider.d.ts +0 -12
- package/esm/src/data-providers/rest-data-provider.d.ts +0 -39
- package/esm/src/data-providers/sql-database.d.ts +0 -33
- package/esm/src/data-providers/web-sql-data-provider.d.ts +0 -21
- package/esm/src/entity.d.ts +0 -126
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.d.ts +0 -51
- package/esm/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -0
- package/esm/src/filter/filter-consumer-bridge-to-url-builder.js +0 -0
- package/esm/src/filter/filter-interfaces.d.ts +0 -74
- package/esm/src/live-query/LiveQueryClient.d.ts +0 -1
- package/esm/src/live-query/SseSubscriptionClient.d.ts +0 -5
- package/esm/src/live-query/SubscriptionChannel.d.ts +0 -41
- package/esm/src/live-query/SubscriptionServer.d.ts +0 -38
- package/esm/src/remult-proxy.d.ts +0 -2
- package/esm/src/remult3/DecoratorReplacer.d.ts +0 -9
- package/esm/src/remult3/Fields.d.ts +0 -133
- package/esm/src/remult3/IdEntity.d.ts +0 -4
- package/esm/src/remult3/RepositoryImplementation.d.ts +0 -289
- package/esm/src/remult3/__updateEntityBasedOnWhere.d.ts +0 -2
- package/esm/src/remult3/columnInfo.d.ts +0 -6
- package/esm/src/remult3/entity.d.ts +0 -28
- package/esm/src/remult3/getEntityRef.d.ts +0 -9
- package/esm/src/remult3/relation-loader-types.d.ts +0 -7
- package/esm/src/remult3/relation-loader.d.ts +0 -40
- package/esm/src/remult3/relationInfoMember.d.ts +0 -4
- package/esm/src/remult3/remult3.d.ts +0 -604
- package/esm/src/remult3/repository-internals.d.ts +0 -14
- package/esm/src/resultCompoundIdFilter.d.ts +0 -3
- package/esm/src/server-action-info.d.ts +0 -10
- package/esm/src/server-action.d.ts +0 -79
- package/esm/src/sort.d.ts +0 -16
- package/esm/src/sql-command.d.ts +0 -19
- package/esm/src/validators.d.ts +0 -14
- package/esm/src/valueConverters.d.ts +0 -13
- package/esm/urlBuilder.d.ts +0 -6
- package/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -0
- package/src/filter/filter-consumer-bridge-to-url-builder.js +0 -0
package/esm/remult-nuxt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readBody } from 'h3';
|
|
2
|
-
import { createRemultServer
|
|
1
|
+
import { readBody, setResponseStatus } from 'h3';
|
|
2
|
+
import { createRemultServer } from './server/index.js';
|
|
3
3
|
export function remultNuxt(options) {
|
|
4
4
|
const result = createRemultServer(options, {
|
|
5
5
|
buildGenericRequestInfo: (event) => {
|
|
@@ -36,14 +36,16 @@ export function remultNuxt(options) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (r) {
|
|
39
|
+
if (r.statusCode !== 200)
|
|
40
|
+
setResponseStatus(event, r.statusCode);
|
|
39
41
|
return r.data;
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
return Object.assign(handler, {
|
|
43
45
|
getRemult: (req) => result.getRemult(req),
|
|
44
46
|
openApiDoc: (options) => result.openApiDoc(options),
|
|
45
|
-
withRemult(
|
|
46
|
-
return result.withRemultAsync(
|
|
47
|
+
withRemult(request, what) {
|
|
48
|
+
return result.withRemultAsync(request, what);
|
|
47
49
|
},
|
|
48
50
|
});
|
|
49
51
|
}
|
|
@@ -21,11 +21,11 @@ class JsonEntityDataProvider {
|
|
|
21
21
|
async loadEntityData(what) {
|
|
22
22
|
let data = [];
|
|
23
23
|
let dbName = await this.entity.options.dbName;
|
|
24
|
-
let s = this.helper.getItem(dbName);
|
|
24
|
+
let s = await this.helper.getItem(dbName);
|
|
25
25
|
if (s)
|
|
26
26
|
data = JSON.parse(s);
|
|
27
27
|
let dp = new ArrayEntityDataProvider(this.entity, data);
|
|
28
|
-
return what(dp, () => this.helper.setItem(dbName, JSON.stringify(data, undefined, 2)));
|
|
28
|
+
return what(dp, async () => await this.helper.setItem(dbName, JSON.stringify(data, undefined, 2)));
|
|
29
29
|
}
|
|
30
30
|
p = Promise.resolve();
|
|
31
31
|
find(options) {
|
|
@@ -35,20 +35,20 @@ class JsonEntityDataProvider {
|
|
|
35
35
|
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.count(where))));
|
|
36
36
|
}
|
|
37
37
|
update(id, data) {
|
|
38
|
-
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.update(id, data).then((x) => {
|
|
39
|
-
save();
|
|
38
|
+
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.update(id, data).then(async (x) => {
|
|
39
|
+
await save();
|
|
40
40
|
return x;
|
|
41
41
|
}))));
|
|
42
42
|
}
|
|
43
43
|
delete(id) {
|
|
44
|
-
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.delete(id).then((x) => {
|
|
45
|
-
save();
|
|
44
|
+
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.delete(id).then(async (x) => {
|
|
45
|
+
await save();
|
|
46
46
|
return x;
|
|
47
47
|
}))));
|
|
48
48
|
}
|
|
49
49
|
async insert(data) {
|
|
50
|
-
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.insert(data).then((x) => {
|
|
51
|
-
save();
|
|
50
|
+
return (this.p = this.p.then(() => this.loadEntityData((dp, save) => dp.insert(data).then(async (x) => {
|
|
51
|
+
await save();
|
|
52
52
|
return x;
|
|
53
53
|
}))));
|
|
54
54
|
}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/*p1 - V - with remult async for remultexpress
|
|
9
|
-
//y1 - lint tests (reference to js)
|
|
10
|
-
//p1 - V Operator '>' cannot be applied to types 'Number' and 'number'.ts(2365) - change fields to <entityType,number> (now it's Number)
|
|
11
|
-
//p1 - V Field(()=>String) - doesn't play nice with strict mode - it prevents people from extending basic types
|
|
12
|
-
//p1 - V withRemult function Add a with remult to Remult! - there is an existing one called Remult.run
|
|
13
|
-
//p1 - V - dbname to metadata consider making dbname in the field metadata options - non optional, so it'll be clear that it always have value - something like require the specific key - or move it to the metadata field
|
|
14
|
-
//p1 - V - getEntityRefClone What I would like is to make a copy of the item (without getting it from the server again)
|
|
15
|
-
//p1 - V find one i had a question about find first's different syntax from find that confused a user
|
|
16
|
-
|
|
17
|
-
rename V - withremultpromise to that withRemultAsync
|
|
18
|
-
expose live query storage in remult
|
|
19
|
-
|
|
20
|
-
request optional - and depends on that run `getUser` & `initRequest`
|
|
21
|
-
*/
|
|
2
|
+
/*y1 - investigated sqlite in web, the chrome recommendation seemed hardly used -
|
|
3
|
+
- https://developer.chrome.com/blog/sqlite-wasm-in-the-browser-backed-by-the-origin-private-file-system/
|
|
4
|
+
- https://www.npmjs.com/package/@sqlite.org/sqlite-wasm
|
|
5
|
+
All I could find is correspondance around evolu :) the guy I met in prague last year
|
|
6
|
+
Indexed db was also annoying with it's upgrade process etc...
|
|
7
|
+
I'm OPFS & json for now.
|
|
22
8
|
//y2 - from the crm-demo(https://crm-demo.up.railway.app/deals), after editing a deal: - _updateEntityBasedOnApi
|
|
9
|
+
|
|
23
10
|
//y2 - Backend methods are transactions, it's not intuitive and maybe should be optional / opt in
|
|
24
11
|
//y2 - how to run a transaction as a user
|
|
25
12
|
//p1 - enum column
|
package/package.json
CHANGED
package/remult-nuxt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
|
-
import { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
|
|
2
|
+
import type { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
|
|
3
3
|
export declare function remultNuxt(options: RemultServerOptions<H3Event>): RemultNuxtServer;
|
|
4
4
|
export type RemultNuxtServer = RemultServerCore<H3Event> & ((event: H3Event) => Promise<any>) & {
|
|
5
5
|
withRemult: RemultServer<H3Event>['withRemultAsync'];
|
package/remult-nuxt.js
CHANGED
|
@@ -57,6 +57,8 @@ function remultNuxt(options) {
|
|
|
57
57
|
_a.label = 3;
|
|
58
58
|
case 3:
|
|
59
59
|
if (r) {
|
|
60
|
+
if (r.statusCode !== 200)
|
|
61
|
+
(0, h3_1.setResponseStatus)(event, r.statusCode);
|
|
60
62
|
return [2 /*return*/, r.data];
|
|
61
63
|
}
|
|
62
64
|
return [2 /*return*/];
|
|
@@ -66,8 +68,8 @@ function remultNuxt(options) {
|
|
|
66
68
|
return Object.assign(handler, {
|
|
67
69
|
getRemult: function (req) { return result.getRemult(req); },
|
|
68
70
|
openApiDoc: function (options) { return result.openApiDoc(options); },
|
|
69
|
-
withRemult: function (
|
|
70
|
-
return result.withRemultAsync(
|
|
71
|
+
withRemult: function (request, what) {
|
|
72
|
+
return result.withRemultAsync(request, what);
|
|
71
73
|
},
|
|
72
74
|
});
|
|
73
75
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DataProvider, EntityDataProvider } from '../data-interfaces.js';
|
|
2
2
|
import type { EntityMetadata } from '../remult3/remult3.js';
|
|
3
3
|
export interface JsonEntityStorage {
|
|
4
|
-
getItem(entityDbName: string): string | null
|
|
5
|
-
setItem(entityDbName: string, json: string):
|
|
4
|
+
getItem(entityDbName: string): string | null | Promise<string | null>;
|
|
5
|
+
setItem(entityDbName: string, json: string): void | Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
export declare class JsonDataProvider implements DataProvider {
|
|
8
8
|
private storage;
|
|
@@ -42,13 +42,18 @@ var JsonEntityDataProvider = /** @class */ (function () {
|
|
|
42
42
|
return [4 /*yield*/, this.entity.options.dbName];
|
|
43
43
|
case 1:
|
|
44
44
|
dbName = _a.sent();
|
|
45
|
-
|
|
45
|
+
return [4 /*yield*/, this.helper.getItem(dbName)];
|
|
46
|
+
case 2:
|
|
47
|
+
s = _a.sent();
|
|
46
48
|
if (s)
|
|
47
49
|
data = JSON.parse(s);
|
|
48
50
|
dp = new array_entity_data_provider_js_1.ArrayEntityDataProvider(this.entity, data);
|
|
49
|
-
return [2 /*return*/, what(dp, function () {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
return [2 /*return*/, what(dp, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0: return [4 /*yield*/, this.helper.setItem(dbName, JSON.stringify(data, undefined, 2))];
|
|
54
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
55
|
+
}
|
|
56
|
+
}); }); })];
|
|
52
57
|
}
|
|
53
58
|
});
|
|
54
59
|
});
|
|
@@ -69,10 +74,16 @@ var JsonEntityDataProvider = /** @class */ (function () {
|
|
|
69
74
|
var _this = this;
|
|
70
75
|
return (this.p = this.p.then(function () {
|
|
71
76
|
return _this.loadEntityData(function (dp, save) {
|
|
72
|
-
return dp.update(id, data).then(function (x) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
return dp.update(id, data).then(function (x) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
78
|
+
return tslib_1.__generator(this, function (_a) {
|
|
79
|
+
switch (_a.label) {
|
|
80
|
+
case 0: return [4 /*yield*/, save()];
|
|
81
|
+
case 1:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/, x];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); });
|
|
76
87
|
});
|
|
77
88
|
}));
|
|
78
89
|
};
|
|
@@ -80,10 +91,16 @@ var JsonEntityDataProvider = /** @class */ (function () {
|
|
|
80
91
|
var _this = this;
|
|
81
92
|
return (this.p = this.p.then(function () {
|
|
82
93
|
return _this.loadEntityData(function (dp, save) {
|
|
83
|
-
return dp.delete(id).then(function (x) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
return dp.delete(id).then(function (x) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
95
|
+
return tslib_1.__generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0: return [4 /*yield*/, save()];
|
|
98
|
+
case 1:
|
|
99
|
+
_a.sent();
|
|
100
|
+
return [2 /*return*/, x];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}); });
|
|
87
104
|
});
|
|
88
105
|
}));
|
|
89
106
|
};
|
|
@@ -93,10 +110,16 @@ var JsonEntityDataProvider = /** @class */ (function () {
|
|
|
93
110
|
return tslib_1.__generator(this, function (_a) {
|
|
94
111
|
return [2 /*return*/, (this.p = this.p.then(function () {
|
|
95
112
|
return _this.loadEntityData(function (dp, save) {
|
|
96
|
-
return dp.insert(data).then(function (x) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
return dp.insert(data).then(function (x) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
114
|
+
return tslib_1.__generator(this, function (_a) {
|
|
115
|
+
switch (_a.label) {
|
|
116
|
+
case 0: return [4 /*yield*/, save()];
|
|
117
|
+
case 1:
|
|
118
|
+
_a.sent();
|
|
119
|
+
return [2 /*return*/, x];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}); });
|
|
100
123
|
});
|
|
101
124
|
}))];
|
|
102
125
|
});
|
package/src/remult3/remult3.d.ts
CHANGED
|
@@ -588,26 +588,6 @@ export interface ClassDecoratorContextStub<Class extends new (...args: any) => a
|
|
|
588
588
|
addInitializer(initializer: (this: Class) => void): void;
|
|
589
589
|
}
|
|
590
590
|
export type ClassFieldDecorator<entityType, valueType> = (target: any, context: string | ClassFieldDecoratorContextStub<entityType, valueType | undefined>, c?: any) => void;
|
|
591
|
-
/**
|
|
592
|
-
* //p2 - doc this
|
|
593
|
-
remult.apiClient.httpClient = (
|
|
594
|
-
input: RequestInfo | URL,
|
|
595
|
-
init?: RequestInit
|
|
596
|
-
) => {
|
|
597
|
-
return fetch(input, {
|
|
598
|
-
...init,
|
|
599
|
-
headers: {
|
|
600
|
-
authorization: 'Bearer ' + sessionStorage.sessionId,
|
|
601
|
-
},
|
|
602
|
-
cache: 'no-store',
|
|
603
|
-
})
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
&&
|
|
607
|
-
remult.apiClient.url='localhost:3007/api
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
*/
|
|
611
591
|
/**
|
|
612
592
|
* our default is allow null false.
|
|
613
593
|
* for sql databases we add a db default of 0/''/false
|
package/src/remult3/remult3.js
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/*p1 - V - with remult async for remultexpress
|
|
10
|
-
//y1 - lint tests (reference to js)
|
|
11
|
-
//p1 - V Operator '>' cannot be applied to types 'Number' and 'number'.ts(2365) - change fields to <entityType,number> (now it's Number)
|
|
12
|
-
//p1 - V Field(()=>String) - doesn't play nice with strict mode - it prevents people from extending basic types
|
|
13
|
-
//p1 - V withRemult function Add a with remult to Remult! - there is an existing one called Remult.run
|
|
14
|
-
//p1 - V - dbname to metadata consider making dbname in the field metadata options - non optional, so it'll be clear that it always have value - something like require the specific key - or move it to the metadata field
|
|
15
|
-
//p1 - V - getEntityRefClone What I would like is to make a copy of the item (without getting it from the server again)
|
|
16
|
-
//p1 - V find one i had a question about find first's different syntax from find that confused a user
|
|
17
|
-
|
|
18
|
-
rename V - withremultpromise to that withRemultAsync
|
|
19
|
-
expose live query storage in remult
|
|
20
|
-
|
|
21
|
-
request optional - and depends on that run `getUser` & `initRequest`
|
|
22
|
-
*/
|
|
3
|
+
/*y1 - investigated sqlite in web, the chrome recommendation seemed hardly used -
|
|
4
|
+
- https://developer.chrome.com/blog/sqlite-wasm-in-the-browser-backed-by-the-origin-private-file-system/
|
|
5
|
+
- https://www.npmjs.com/package/@sqlite.org/sqlite-wasm
|
|
6
|
+
All I could find is correspondance around evolu :) the guy I met in prague last year
|
|
7
|
+
Indexed db was also annoying with it's upgrade process etc...
|
|
8
|
+
I'm OPFS & json for now.
|
|
23
9
|
//y2 - from the crm-demo(https://crm-demo.up.railway.app/deals), after editing a deal: - _updateEntityBasedOnApi
|
|
10
|
+
|
|
24
11
|
//y2 - Backend methods are transactions, it's not intuitive and maybe should be optional / opt in
|
|
25
12
|
//y2 - how to run a transaction as a user
|
|
26
13
|
//p1 - enum column
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { GenericResponse } from './server/index';
|
|
3
|
-
import type { Remult } from './src/context';
|
|
4
|
-
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
5
|
-
export declare class SseSubscriptionServer implements SubscriptionServer {
|
|
6
|
-
private canUserConnectToChannel?;
|
|
7
|
-
constructor(canUserConnectToChannel?: (channel: string, remult: Remult) => boolean);
|
|
8
|
-
publishMessage<T>(channel: string, message: any): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export interface ResponseRequiredForSSE {
|
|
11
|
-
write(data: string): void;
|
|
12
|
-
writeHead(status: number, headers: any): void;
|
|
13
|
-
flush?(): void;
|
|
14
|
-
}
|
|
15
|
-
export declare class clientConnection {
|
|
16
|
-
response: GenericResponse & ResponseRequiredForSSE;
|
|
17
|
-
channels: Record<string, boolean>;
|
|
18
|
-
timeOutRef: NodeJS.Timeout;
|
|
19
|
-
close(): void;
|
|
20
|
-
closed: boolean;
|
|
21
|
-
write(eventData: string, eventType?: string): void;
|
|
22
|
-
connectionId: any;
|
|
23
|
-
constructor(response: GenericResponse & ResponseRequiredForSSE);
|
|
24
|
-
sendLiveMessage(): void;
|
|
25
|
-
}
|
package/esm/ably.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type * as Ably from '../../node_modules/ably';
|
|
2
|
-
import type { SubscriptionClient, SubscriptionClientConnection } from './src/live-query/SubscriptionChannel';
|
|
3
|
-
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
4
|
-
export declare class AblySubscriptionClient implements SubscriptionClient {
|
|
5
|
-
private ably;
|
|
6
|
-
constructor(ably: Ably.Types.RealtimePromise);
|
|
7
|
-
openConnection(onReconnect: VoidFunction): Promise<SubscriptionClientConnection>;
|
|
8
|
-
}
|
|
9
|
-
export declare class AblySubscriptionServer implements SubscriptionServer {
|
|
10
|
-
private ably;
|
|
11
|
-
constructor(ably: Ably.Types.RestPromise);
|
|
12
|
-
publishMessage<T>(channel: string, message: T): Promise<void>;
|
|
13
|
-
}
|
package/esm/assign.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function assign<T>(item: T, valuesToSet: Partial<T>): T;
|
package/esm/classType.d.ts
DELETED
package/esm/graphql.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ClassType } from './classType';
|
|
2
|
-
import { Remult } from './index';
|
|
3
|
-
export declare function remultGraphql(options: {
|
|
4
|
-
removeComments?: boolean;
|
|
5
|
-
entities: ClassType<any>[];
|
|
6
|
-
getRemultFromRequest?: (req: any) => Remult;
|
|
7
|
-
}): {
|
|
8
|
-
resolvers: {
|
|
9
|
-
Query: Record<string, unknown>;
|
|
10
|
-
Mutation: Record<string, unknown>;
|
|
11
|
-
};
|
|
12
|
-
rootValue: Record<string, any>;
|
|
13
|
-
typeDefs: string;
|
|
14
|
-
};
|
package/esm/index.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { ClassType } from './classType';
|
|
2
|
-
export type { ClassType } from './classType';
|
|
3
|
-
export { MembersOnly, FieldsMetadata, FieldRef, IdFieldRef, FieldsRef, EntityMetadata, EntityOrderBy, EntityFilter, FindOptions, FindOptionsBase, QueryResult, QueryOptions, Repository, FindFirstOptions, ComparisonValueFilter, ValueFilter, IdFilter, ContainsStringValueFilter, EntityRef, SortSegments, Paginator, LiveQuery, LiveQueryChangeInfo, Subscribable, RefSubscriber, RefSubscriberBase, RelationOptions, ObjectMembersOnly, MembersToInclude, RepositoryRelations, EntityIdFields, ClassFieldDecorator, ClassFieldDecoratorContextStub, //n1 consider removing in ts5
|
|
4
|
-
LifecycleEvent, FieldsRefBase, FieldsRefForEntityBase, RepositoryRelationsForEntityBase, ControllerRefForControllerBase, ControllerRefBase, ControllerRef, EntityRefForEntityBase, IdMetadata, FindFirstOptionsBase, } from './src/remult3/remult3';
|
|
5
|
-
export { EntityBase, ControllerBase, FieldType, getFields, ValueListFieldType, getValueList, ValueListFieldOptions, ValueListInfo, CaptionTransformer, } from './src/remult3/RepositoryImplementation';
|
|
6
|
-
export { Entity } from './src/remult3/entity';
|
|
7
|
-
export { getEntityRef } from './src/remult3/getEntityRef';
|
|
8
|
-
export { Field, Fields, StringFieldOptions, Relations, } from './src/remult3/Fields';
|
|
9
|
-
export { IdEntity } from './src/remult3/IdEntity';
|
|
10
|
-
export { describeClass } from './src/remult3/DecoratorReplacer';
|
|
11
|
-
export { EntityOptions } from './src/entity';
|
|
12
|
-
export { DataProvider, EntityDataProvider, EntityDataProviderFindOptions, ErrorInfo, RestDataProviderHttpProvider, } from './src/data-interfaces';
|
|
13
|
-
export { SqlCommand, SqlCommandWithParameters, SqlImplementation, SqlResult, } from './src/sql-command';
|
|
14
|
-
export { FieldMetadata, FieldOptions, FieldValidator, ValueConverter, ValueListItem, // reconsider, maybe it should go to remult angular as the abstraction ?
|
|
15
|
-
ValueOrExpression, } from './src/column-interfaces';
|
|
16
|
-
export { RestDataProvider } from './src/data-providers/rest-data-provider';
|
|
17
|
-
export { InMemoryDataProvider } from './src/data-providers/in-memory-database';
|
|
18
|
-
export { WebSqlDataProvider } from './src/data-providers/web-sql-data-provider';
|
|
19
|
-
export { SqlDatabase } from './src/data-providers/sql-database';
|
|
20
|
-
export { CustomSqlFilterObject, CustomSqlFilterBuilder, dbNamesOf, CustomSqlFilterBuilderFunction, EntityDbNames, } from './src/filter/filter-consumer-bridge-to-sql-request';
|
|
21
|
-
export { JsonDataProvider, JsonEntityStorage, } from './src/data-providers/json-data-provider';
|
|
22
|
-
export { Controller, BackendMethodOptions, BackendMethod, ProgressListener, } from './src/server-action';
|
|
23
|
-
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource, UserInfo, } from './src/context';
|
|
24
|
-
export { ExternalHttpProvider } from './src/buildRestDataProvider';
|
|
25
|
-
export { SortSegment, Sort } from './src/sort';
|
|
26
|
-
export { CompoundIdField } from './src/CompoundIdField';
|
|
27
|
-
export { Filter, FilterConsumer, customFilterInfo, } from './src/filter/filter-interfaces';
|
|
28
|
-
export { UrlBuilder } from './urlBuilder';
|
|
29
|
-
export { Validators } from './src/validators';
|
|
30
|
-
export { ValueConverters } from './src/valueConverters';
|
|
31
|
-
export { remult } from './src/remult-proxy';
|
|
32
|
-
export { SubscriptionServer, LiveQueryStorage, StoredQuery, InMemoryLiveQueryStorage, } from './src/live-query/SubscriptionServer';
|
|
33
|
-
export { SubscriptionListener, SubscriptionClientConnection, SubscriptionClient, SubscriptionChannel, LiveQueryChange, Unsubscribe, } from './src/live-query/SubscriptionChannel';
|
|
34
|
-
/**
|
|
35
|
-
* A convenient shortcut function to quickly obtain a repository for a specific entity type in Remult.
|
|
36
|
-
*
|
|
37
|
-
* @param entity The entity class type for which you want to get a repository.
|
|
38
|
-
* @returns A repository instance for the specified entity type.
|
|
39
|
-
*
|
|
40
|
-
* Example usage:
|
|
41
|
-
* ```ts
|
|
42
|
-
* await repo(Task).find()
|
|
43
|
-
* await repo(Customer).insert()
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function repo<entityType>(entity: ClassType<entityType>): import("./src/remult3/remult3").Repository<entityType>;
|
package/esm/inputTypes.d.ts
DELETED
package/esm/internals.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { getRelationInfo } from './src/remult3/relationInfoMember';
|
|
2
|
-
export { decorateColumnSettings, controllerRefImpl, getControllerRef, } from './src/remult3/RepositoryImplementation';
|
|
3
|
-
export { getEntitySettings } from './src/remult3/getEntityRef';
|
|
4
|
-
export { __updateEntityBasedOnWhere } from './src/filter/filter-interfaces';
|
|
5
|
-
export { actionInfo } from './src/server-action-info';
|
|
6
|
-
export { RelationInfo } from './src/remult3/remult3';
|
|
7
|
-
export { ClassType } from './classType';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DataProvider, Storage } from '../src/data-interfaces';
|
|
2
|
-
import type { LiveQueryStorage, StoredQuery } from '../src/live-query/SubscriptionServer';
|
|
3
|
-
import type { Repository } from '../src/remult3/remult3';
|
|
4
|
-
import { EntityBase } from '../src/remult3/RepositoryImplementation';
|
|
5
|
-
export declare class DataProviderLiveQueryStorage implements LiveQueryStorage, Storage {
|
|
6
|
-
repo: Promise<Repository<LiveQueryStorageEntity>>;
|
|
7
|
-
dataProvider: Promise<DataProvider>;
|
|
8
|
-
constructor(dataProvider: DataProvider | Promise<DataProvider> | (() => Promise<DataProvider | undefined>));
|
|
9
|
-
ensureSchema(): Promise<void>;
|
|
10
|
-
add({ id, entityKey, data }: StoredQuery): Promise<void>;
|
|
11
|
-
remove(queryId: string): Promise<void>;
|
|
12
|
-
forEach(entityKey: string, callback: (args: {
|
|
13
|
-
query: StoredQuery;
|
|
14
|
-
setData(data: any): Promise<void>;
|
|
15
|
-
}) => Promise<void>): Promise<void>;
|
|
16
|
-
keepAliveAndReturnUnknownQueryIds(queryIds: string[]): Promise<string[]>;
|
|
17
|
-
}
|
|
18
|
-
export declare class LiveQueryStorageEntity extends EntityBase {
|
|
19
|
-
id: string;
|
|
20
|
-
entityKey: string;
|
|
21
|
-
data: any;
|
|
22
|
-
lastUsedIso: string;
|
|
23
|
-
}
|
package/esm/myLog.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function writeToLog(what: any): Promise<void>;
|
package/esm/postgres/index.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ClientBase, PoolConfig, QueryResult } from 'pg';
|
|
2
|
-
import { Remult } from '../src/context';
|
|
3
|
-
import { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
-
import type { EntityMetadata } from '../src/remult3/remult3';
|
|
5
|
-
import type { SqlCommand, SqlImplementation } from '../src/sql-command';
|
|
6
|
-
export interface PostgresPool extends PostgresCommandSource {
|
|
7
|
-
connect(): Promise<PostgresClient>;
|
|
8
|
-
}
|
|
9
|
-
export interface PostgresClient extends PostgresCommandSource {
|
|
10
|
-
release(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare class PostgresDataProvider implements SqlImplementation {
|
|
13
|
-
private pool;
|
|
14
|
-
supportsJsonColumnType: boolean;
|
|
15
|
-
static getDb(remult?: Remult): ClientBase;
|
|
16
|
-
entityIsUsedForTheFirstTime(entity: EntityMetadata): Promise<void>;
|
|
17
|
-
getLimitSqlSyntax(limit: number, offset: number): string;
|
|
18
|
-
createCommand(): SqlCommand;
|
|
19
|
-
constructor(pool: PostgresPool);
|
|
20
|
-
ensureSchema(entities: EntityMetadata<any>[]): Promise<void>;
|
|
21
|
-
transaction(action: (dataProvider: SqlImplementation) => Promise<void>): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export interface PostgresCommandSource {
|
|
24
|
-
query(queryText: string, values?: any[]): Promise<QueryResult>;
|
|
25
|
-
}
|
|
26
|
-
export declare function createPostgresConnection(options?: {
|
|
27
|
-
connectionString?: string;
|
|
28
|
-
sslInDev?: boolean;
|
|
29
|
-
configuration?: 'heroku' | PoolConfig;
|
|
30
|
-
}): Promise<SqlDatabase>;
|
|
31
|
-
export declare function createPostgresDataProvider(options?: {
|
|
32
|
-
connectionString?: string;
|
|
33
|
-
sslInDev?: boolean;
|
|
34
|
-
configuration?: 'heroku' | PoolConfig;
|
|
35
|
-
}): Promise<SqlDatabase>;
|
|
36
|
-
export declare function preparePostgresQueueStorage(sql: SqlDatabase): Promise<import("../server/expressBridge").EntityQueueStorage>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FieldMetadata } from '../src/column-interfaces';
|
|
2
|
-
import type { Remult } from '../src/context';
|
|
3
|
-
import type { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
-
import type { EntityMetadata } from '../src/remult3/remult3';
|
|
5
|
-
export declare function postgresColumnSyntax(x: FieldMetadata, dbName: string): string;
|
|
6
|
-
export declare function verifyStructureOfAllEntities(db: SqlDatabase, remult: Remult): Promise<void>;
|
|
7
|
-
export declare class PostgresSchemaBuilder {
|
|
8
|
-
private pool;
|
|
9
|
-
private removeQuotes;
|
|
10
|
-
private whereTableAndSchema;
|
|
11
|
-
private schemaAndName;
|
|
12
|
-
private schemaOnly;
|
|
13
|
-
verifyStructureOfAllEntities(remult?: Remult): Promise<void>;
|
|
14
|
-
ensureSchema(entities: EntityMetadata<any>[]): Promise<void>;
|
|
15
|
-
createIfNotExist(entity: EntityMetadata): Promise<void>;
|
|
16
|
-
addColumnIfNotExist<T extends EntityMetadata>(entity: T, c: (e: T) => FieldMetadata): Promise<void>;
|
|
17
|
-
verifyAllColumns<T extends EntityMetadata>(entity: T): Promise<void>;
|
|
18
|
-
specifiedSchema: string;
|
|
19
|
-
constructor(pool: SqlDatabase, schema?: string);
|
|
20
|
-
}
|
package/esm/remult-express.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as express from 'express';
|
|
2
|
-
import type { RemultServerCore, RemultServerOptions } from './server/expressBridge';
|
|
3
|
-
export declare function remultExpress(options?: RemultServerOptions<express.Request> & {
|
|
4
|
-
bodyParser?: boolean;
|
|
5
|
-
bodySizeLimit?: string;
|
|
6
|
-
}): RemultExpressServer;
|
|
7
|
-
export type RemultExpressServer = express.RequestHandler & RemultServerCore<express.Request> & {
|
|
8
|
-
withRemult: (req: express.Request, res: express.Response, next: VoidFunction) => void;
|
|
9
|
-
};
|
package/esm/remult-fastify.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { FastifyPluginCallback, FastifyRequest } from 'fastify';
|
|
2
|
-
import type { RemultServerCore, RemultServerOptions } from './server/expressBridge';
|
|
3
|
-
export declare function remultFastify(options: RemultServerOptions<FastifyRequest>): RemultFastifyServer;
|
|
4
|
-
export type RemultFastifyServer = FastifyPluginCallback & RemultServerCore<FastifyRequest> & {
|
|
5
|
-
withRemult<T>(req: FastifyRequest, what: () => Promise<T>): Promise<T>;
|
|
6
|
-
};
|
package/esm/remult-fresh.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RemultServerCore, RemultServerOptions } from './server/expressBridge';
|
|
2
|
-
export declare function remultFresh(options: RemultServerOptions<FreshRequest>, response: FreshResponse): RemultFresh;
|
|
3
|
-
export interface RemultFresh extends RemultServerCore<FreshRequest> {
|
|
4
|
-
handle(req: FreshRequest, ctx: FreshContext): Promise<any>;
|
|
5
|
-
}
|
|
6
|
-
export interface FreshRequest {
|
|
7
|
-
url: string;
|
|
8
|
-
method: string;
|
|
9
|
-
json: () => Promise<any>;
|
|
10
|
-
}
|
|
11
|
-
export interface FreshContext {
|
|
12
|
-
next: () => Promise<any>;
|
|
13
|
-
}
|
|
14
|
-
export interface FreshResponse {
|
|
15
|
-
new (body?: any | undefined, init?: ResponseInit): any;
|
|
16
|
-
json(data: unknown, init?: ResponseInit): any;
|
|
17
|
-
}
|
package/esm/remult-hapi.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Request, Plugin } from '@hapi/hapi';
|
|
2
|
-
import { type RemultServerCore, type RemultServerOptions } from './server';
|
|
3
|
-
export declare function remultHapi(options: RemultServerOptions<Request>): RemultHapiServer;
|
|
4
|
-
export type RemultHapiServer = Plugin<any, any> & RemultServerCore<Request> & {
|
|
5
|
-
withRemult<T>(req: Request, what: () => Promise<T>): Promise<T>;
|
|
6
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Knex } from 'knex';
|
|
2
|
-
import type { Remult } from '../src/context';
|
|
3
|
-
import type { FieldMetadata } from '../src/column-interfaces';
|
|
4
|
-
import type { DataProvider, EntityDataProvider } from '../src/data-interfaces';
|
|
5
|
-
import type { EntityFilter, EntityMetadata } from '../src/remult3/remult3';
|
|
6
|
-
import type { RepositoryOverloads } from '../src/remult3/RepositoryImplementation';
|
|
7
|
-
export declare class KnexDataProvider implements DataProvider {
|
|
8
|
-
knex: Knex;
|
|
9
|
-
constructor(knex: Knex);
|
|
10
|
-
static getDb(remult?: Remult): Knex<any, any[]>;
|
|
11
|
-
getEntityDataProvider(entity: EntityMetadata<any>): EntityDataProvider;
|
|
12
|
-
transaction(action: (dataProvider: DataProvider) => Promise<void>): Promise<void>;
|
|
13
|
-
static rawFilter(build: CustomKnexFilterBuilderFunction): EntityFilter<any>;
|
|
14
|
-
static filterToRaw<entityType>(entity: RepositoryOverloads<entityType>, condition: EntityFilter<entityType>): Promise<(knex: any) => void>;
|
|
15
|
-
isProxy?: boolean;
|
|
16
|
-
ensureSchema(entities: EntityMetadata<any>[]): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export type CustomKnexFilterBuilderFunction = () => Promise<(builder: Knex.QueryBuilder) => void>;
|
|
19
|
-
export declare class KnexSchemaBuilder {
|
|
20
|
-
private knex;
|
|
21
|
-
verifyStructureOfAllEntities(remult?: Remult): Promise<void>;
|
|
22
|
-
ensureSchema(entities: EntityMetadata<any>[]): Promise<void>;
|
|
23
|
-
createIfNotExist(entity: EntityMetadata): Promise<void>;
|
|
24
|
-
addColumnIfNotExist<T extends EntityMetadata>(entity: T, c: (e: T) => FieldMetadata): Promise<void>;
|
|
25
|
-
verifyAllColumns<T extends EntityMetadata>(entity: T): Promise<void>;
|
|
26
|
-
additionalWhere: string;
|
|
27
|
-
constructor(knex: Knex);
|
|
28
|
-
}
|
|
29
|
-
export declare function buildColumn(x: FieldMetadata, dbName: string, b: Knex.CreateTableBuilder, supportsJson?: boolean): void;
|
|
30
|
-
export declare function createKnexDataProvider(config: Knex.Config): Promise<KnexDataProvider>;
|
package/esm/remult-mongo.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type ClientSession, type Db, type MongoClient } from 'mongodb';
|
|
2
|
-
import type { DataProvider, EntityDataProvider, EntityFilter, EntityMetadata, Remult } from '.';
|
|
3
|
-
import type { RepositoryOverloads } from './src/remult3/RepositoryImplementation';
|
|
4
|
-
export declare class MongoDataProvider implements DataProvider {
|
|
5
|
-
private db;
|
|
6
|
-
private client;
|
|
7
|
-
constructor(db: Db, client: MongoClient | undefined, options?: {
|
|
8
|
-
session?: ClientSession;
|
|
9
|
-
disableTransactions?: boolean;
|
|
10
|
-
});
|
|
11
|
-
session?: ClientSession;
|
|
12
|
-
disableTransactions: boolean;
|
|
13
|
-
static getDb(remult?: Remult): {
|
|
14
|
-
db: Db;
|
|
15
|
-
session: ClientSession;
|
|
16
|
-
};
|
|
17
|
-
getEntityDataProvider(entity: EntityMetadata<any>): EntityDataProvider;
|
|
18
|
-
transaction(action: (dataProvider: DataProvider) => Promise<void>): Promise<void>;
|
|
19
|
-
static filterToRaw<entityType>(entity: RepositoryOverloads<entityType>, condition: EntityFilter<entityType>): Promise<{
|
|
20
|
-
$and: any[];
|
|
21
|
-
} | {
|
|
22
|
-
$and?: undefined;
|
|
23
|
-
}>;
|
|
24
|
-
}
|