remult 0.27.13 → 0.27.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.
@@ -72,7 +72,7 @@ function buildEntityInfo(options) {
72
72
  }
73
73
  fields.push({
74
74
  key: x.key,
75
- readOnly: x.dbReadOnly || !x.apiUpdateAllowed() || x.isServerExpression,
75
+ readOnly: !x.apiUpdateAllowed(),
76
76
  values: (0, RepositoryImplementation_js_1.getValueList)(x),
77
77
  valFieldKey: valFieldKey,
78
78
  caption: x.caption,
@@ -20,6 +20,8 @@ var isOfType_js_1 = require("../src/isOfType.js");
20
20
  var initDataProviderOrJson_js_1 = require("./initDataProviderOrJson.js");
21
21
  function createRemultServerCore(options, serverCoreOptions) {
22
22
  var safeOptions = options !== null && options !== void 0 ? options : {};
23
+ if (!safeOptions.entities)
24
+ safeOptions.entities = [];
23
25
  if (!safeOptions.subscriptionServer) {
24
26
  safeOptions.subscriptionServer = new SseSubscriptionServer_js_1.SseSubscriptionServer();
25
27
  }
@@ -48,7 +48,7 @@ function verifyFieldRelationInfo(repo, remult, dp) {
48
48
  compoundIdField: undefined,
49
49
  };
50
50
  function buildError(what) {
51
- return Error("Error for relation: \"".concat(field.key, "\" to \"").concat(toRepo_1.metadata.key, "\": ") +
51
+ return Error("Error for relation: \"".concat(repo.metadata.key, ".").concat(field.key, "\", ") +
52
52
  what);
53
53
  }
54
54
  var hasFields = function () { return relationField || relFields.fields; };
@@ -90,7 +90,7 @@ function verifyFieldRelationInfo(repo, remult, dp) {
90
90
  finally { if (e_2) throw e_2.error; }
91
91
  }
92
92
  if (!hasFields())
93
- throw buildError("No matching field found on target. Please specify field/fields");
93
+ throw buildError("No matching field found on target \"".concat(toRepo_1.metadata.key, "\". Please specify field/fields"));
94
94
  }
95
95
  function requireField(field, meta) {
96
96
  var result = meta.fields.find(field);
@@ -539,7 +539,11 @@ export interface Repository<entityType> {
539
539
  deleteMany(options: {
540
540
  where: EntityFilter<entityType>;
541
541
  }): Promise<number>;
542
- /** Creates an instance of an item. It'll not be saved to the data source unless `save` or `insert` will be called for that item */
542
+ /** Creates an instance of an item. It'll not be saved to the data source unless `save` or `insert` will be called.
543
+ *
544
+ * It's usefull to start or reset a form taking your entity default values into account.
545
+ *
546
+ */
543
547
  create(item?: Partial<MembersOnly<entityType>>): entityType;
544
548
  toJson(item: Promise<entityType[]>): Promise<any[]>;
545
549
  toJson(item: entityType[]): any[];
@@ -20,6 +20,7 @@ var wnn = [
20
20
  exports.flags = {
21
21
  error500RetryCount: 4,
22
22
  };
23
+ //p1 - add aggregate to query
23
24
  //p1 - add parameter all to deleteMany, and updateMany
24
25
  //p1 filter.apply ApiPreFilter
25
26
  /*p1 - add id and use uuid by default, but allow changes with Fields.id.defaultIdProvider NO but defaultProvider yes???