remult 0.26.13 → 0.26.15

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.
@@ -1,5 +1,4 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Entity, IdEntity, Fields, remult, Remult, } from '../index.js';
1
+ import { Entity, IdEntity, Fields, remult, Remult, describeClass, } from '../index.js';
3
2
  import { initDataProviderOrJson } from '../server/initDataProviderOrJson.js';
4
3
  import { doTransaction } from '../src/context.js';
5
4
  import { cast, isOfType } from '../src/isOfType.js';
@@ -21,16 +20,12 @@ export async function migrate(options) {
21
20
  const prev = remult.dataProvider;
22
21
  remult.dataProvider = dataProvider;
23
22
  try {
24
- let VersionInfo = class VersionInfo extends IdEntity {
23
+ class VersionInfo extends IdEntity {
25
24
  version = -1;
26
- };
27
- __decorate([
28
- Fields.number(),
29
- __metadata("design:type", Object)
30
- ], VersionInfo.prototype, "version", void 0);
31
- VersionInfo = __decorate([
32
- Entity(migrationTableName)
33
- ], VersionInfo);
25
+ }
26
+ describeClass(VersionInfo, Entity(migrationTableName), {
27
+ version: Fields.integer(),
28
+ });
34
29
  const steps = Object.entries(options.migrations).sort(([a], [b]) => parseInt(a) - parseInt(b));
35
30
  if (dataProvider.ensureSchema) {
36
31
  await dataProvider.ensureSchema([
@@ -32,7 +32,7 @@ export class PostgresDataProvider {
32
32
  this.wrapIdentifier = options.wrapIdentifier;
33
33
  if (!options?.wrapIdentifier && options?.caseInsensitiveIdentifiers)
34
34
  this.wrapIdentifier = (name) => name;
35
- if (options.orderByNullsFirst)
35
+ if (options?.orderByNullsFirst)
36
36
  this.orderByNullsFirst = options.orderByNullsFirst;
37
37
  if (options?.schema) {
38
38
  this.pool = new PostgresSchemaWrapper(pool, options.schema);
@@ -16,7 +16,6 @@ export class KnexDataProvider {
16
16
  end() {
17
17
  return this.knex.destroy();
18
18
  }
19
- /* @internal */
20
19
  provideMigrationBuilder(builder) {
21
20
  var sb = new KnexSchemaBuilder(this.knex);
22
21
  return {
@@ -1,9 +1,15 @@
1
1
  export const flags = {
2
2
  error500RetryCount: 4,
3
3
  };
4
+ //y1 - Talk about the case where we had one to many, without a field - just a filter - for example, event,event participants, users - and a field that shows all users that are not participants
5
+ //p1 - Fix hagai and starter project to latest ts
4
6
  //y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
7
+ //p1 - fix chaining of saving and saved in multiple entity options args
5
8
  //p1 - review starter and examples and separate remult * auth from the routes
6
- //p1 - https://github.com/remult/remult/discussions/438
9
+ /*p1 - https://github.com/remult/remult/discussions/438
10
+ - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
11
+ */
12
+ //p1 - min, max, avg, sum
7
13
  //y1 - live query with count #436
8
14
  //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
9
15
  //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
@@ -79,6 +85,9 @@ const result = await repo.batch(x=>({
79
85
  - allow conditional admin - like allowed
80
86
  - remult-admin doesn't handle primary key that has compound column
81
87
  - remult-admin didn't show a update for a table with a uniqua that is numeric
88
+ - for literal fields, allow selection from list
89
+ - for many to one fields - allow search field selection by developer
90
+ - for toOne relations, show the "one" row and allow its edit.
82
91
  */
83
92
  //remult
84
93
  //p1 - when a tasks table exists in a different schema - we get many errors
@@ -41,15 +41,11 @@ function migrate(options) {
41
41
  _this.version = -1;
42
42
  return _this;
43
43
  }
44
- tslib_1.__decorate([
45
- index_js_1.Fields.number(),
46
- tslib_1.__metadata("design:type", Object)
47
- ], VersionInfo_1.prototype, "version", void 0);
48
- VersionInfo = tslib_1.__decorate([
49
- (0, index_js_1.Entity)(migrationTableName)
50
- ], VersionInfo);
51
44
  return VersionInfo;
52
45
  }(index_js_1.IdEntity));
46
+ (0, index_js_1.describeClass)(VersionInfo_1, (0, index_js_1.Entity)(migrationTableName), {
47
+ version: index_js_1.Fields.integer(),
48
+ });
53
49
  steps_1 = Object.entries(options.migrations).sort(function (_a, _b) {
54
50
  var _c = tslib_1.__read(_a, 1), a = _c[0];
55
51
  var _d = tslib_1.__read(_b, 1), b = _d[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.26.13",
3
+ "version": "0.26.15",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -25,7 +25,7 @@ var PostgresDataProvider = /** @class */ (function () {
25
25
  this.wrapIdentifier = options.wrapIdentifier;
26
26
  if (!(options === null || options === void 0 ? void 0 : options.wrapIdentifier) && (options === null || options === void 0 ? void 0 : options.caseInsensitiveIdentifiers))
27
27
  this.wrapIdentifier = function (name) { return name; };
28
- if (options.orderByNullsFirst)
28
+ if (options === null || options === void 0 ? void 0 : options.orderByNullsFirst)
29
29
  this.orderByNullsFirst = options.orderByNullsFirst;
30
30
  if (options === null || options === void 0 ? void 0 : options.schema) {
31
31
  this.pool = new PostgresSchemaWrapper(pool, options.schema);
@@ -6,11 +6,12 @@ import type { DataProvider, EntityDataProvider } from '../src/data-interfaces.js
6
6
  import type { EntityFilter, EntityMetadata } from '../src/remult3/remult3.js';
7
7
  import type { RepositoryOverloads } from '../src/remult3/RepositoryImplementation.js';
8
8
  import type { HasWrapIdentifier, SqlCommand, SqlCommandFactory, SqlResult } from '../src/sql-command.js';
9
- import type { CanBuildMigrations } from '../migrations/migration-types.js';
9
+ import type { CanBuildMigrations, MigrationBuilder, MigrationCode } from '../migrations/migration-types.js';
10
10
  export declare class KnexDataProvider implements DataProvider, HasWrapIdentifier, SqlCommandFactory, CanBuildMigrations {
11
11
  knex: Knex;
12
12
  constructor(knex: Knex);
13
13
  end(): Promise<void>;
14
+ provideMigrationBuilder(builder: MigrationCode): MigrationBuilder;
14
15
  createCommand(): SqlCommand;
15
16
  execute(sql: string): Promise<SqlResult>;
16
17
  static getDb(dataProvider?: DataProvider): Knex<any, any[]>;
@@ -21,7 +21,6 @@ var KnexDataProvider = /** @class */ (function () {
21
21
  KnexDataProvider.prototype.end = function () {
22
22
  return this.knex.destroy();
23
23
  };
24
- /* @internal */
25
24
  KnexDataProvider.prototype.provideMigrationBuilder = function (builder) {
26
25
  var sb = new KnexSchemaBuilder(this.knex);
27
26
  return {
@@ -4,9 +4,15 @@ exports.flags = void 0;
4
4
  exports.flags = {
5
5
  error500RetryCount: 4,
6
6
  };
7
+ //y1 - Talk about the case where we had one to many, without a field - just a filter - for example, event,event participants, users - and a field that shows all users that are not participants
8
+ //p1 - Fix hagai and starter project to latest ts
7
9
  //y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
10
+ //p1 - fix chaining of saving and saved in multiple entity options args
8
11
  //p1 - review starter and examples and separate remult * auth from the routes
9
- //p1 - https://github.com/remult/remult/discussions/438
12
+ /*p1 - https://github.com/remult/remult/discussions/438
13
+ - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
14
+ */
15
+ //p1 - min, max, avg, sum
10
16
  //y1 - live query with count #436
11
17
  //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
12
18
  //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
@@ -82,6 +88,9 @@ const result = await repo.batch(x=>({
82
88
  - allow conditional admin - like allowed
83
89
  - remult-admin doesn't handle primary key that has compound column
84
90
  - remult-admin didn't show a update for a table with a uniqua that is numeric
91
+ - for literal fields, allow selection from list
92
+ - for many to one fields - allow search field selection by developer
93
+ - for toOne relations, show the "one" row and allow its edit.
85
94
  */
86
95
  //remult
87
96
  //p1 - when a tasks table exists in a different schema - we get many errors