remult 3.0.6-next.0 → 3.0.6

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 (57) hide show
  1. package/esm/graphql.js +3 -3
  2. package/esm/index.js +7 -1
  3. package/esm/remult-d1-http.js +32 -0
  4. package/esm/remult-d1.js +90 -0
  5. package/esm/remult-express.js +4 -1
  6. package/esm/remult-fastify.js +9 -1
  7. package/esm/remult-fresh.js +5 -1
  8. package/esm/remult-hapi.js +7 -6
  9. package/esm/remult-hono.js +16 -14
  10. package/esm/remult-next.js +14 -8
  11. package/esm/remult-nuxt.js +7 -4
  12. package/esm/remult-solid-start.js +9 -6
  13. package/esm/remult-sveltekit.js +11 -8
  14. package/esm/server/index.js +4 -1
  15. package/esm/server/module.js +1 -1
  16. package/esm/server/remult-admin.js +9 -5
  17. package/esm/server/remult-api-server.js +14 -2
  18. package/esm/server/test-api-data-provider.js +4 -1
  19. package/esm/src/CompoundIdField.js +1 -0
  20. package/esm/src/context.js +9 -1
  21. package/esm/src/remult-static.js +1 -1
  22. package/esm/src/remult3/RepositoryImplementation.js +37 -21
  23. package/graphql.js +3 -3
  24. package/index.d.ts +9 -1
  25. package/index.js +9 -2
  26. package/package.json +11 -1
  27. package/remult-d1-http.d.ts +16 -0
  28. package/remult-d1-http.js +46 -0
  29. package/remult-d1.d.ts +27 -0
  30. package/remult-d1.js +128 -0
  31. package/remult-express.js +4 -1
  32. package/remult-fastify.js +6 -1
  33. package/remult-fresh.js +5 -1
  34. package/remult-hapi.js +4 -7
  35. package/remult-hono.js +16 -14
  36. package/remult-next.js +14 -8
  37. package/remult-nuxt.js +7 -4
  38. package/remult-solid-start.js +9 -6
  39. package/remult-sveltekit.js +11 -8
  40. package/server/core.d.ts +1 -1
  41. package/server/index.js +4 -1
  42. package/server/module.js +1 -1
  43. package/server/remult-admin.js +9 -5
  44. package/server/remult-api-server.d.ts +24 -11
  45. package/server/remult-api-server.js +23 -11
  46. package/server/test-api-data-provider.js +4 -1
  47. package/src/CompoundIdField.d.ts +1 -0
  48. package/src/CompoundIdField.js +1 -0
  49. package/src/column-interfaces.d.ts +12 -0
  50. package/src/context.d.ts +15 -2
  51. package/src/context.js +9 -1
  52. package/src/entity.d.ts +5 -0
  53. package/src/remult-static.d.ts +1 -1
  54. package/src/remult-static.js +1 -1
  55. package/src/remult3/RepositoryImplementation.d.ts +23 -17
  56. package/src/remult3/RepositoryImplementation.js +48 -22
  57. package/src/remult3/remult3.d.ts +8 -2
@@ -198,6 +198,12 @@ export interface EntityMetadata<entityType = unknown> {
198
198
  * @see {@link EntityOptions.caption}
199
199
  */
200
200
  readonly caption: string;
201
+ /** A human readable label for the entity. Can be used to achieve a consistent label for a field throughout the app
202
+ * @example
203
+ * <h1>Create a new item in {taskRepo.metadata.label}</h1>
204
+ * @see {@link EntityOptions.label}
205
+ */
206
+ readonly label: string;
201
207
  /** The name of the table in the database that holds the data for this entity.
202
208
  * If no name is set in the entity options, the `key` will be used instead.
203
209
  * @see {@link EntityOptions.dbName}
@@ -641,7 +647,7 @@ export interface Repository<entityType> {
641
647
  getEntityRef(item: entityType): EntityRef<entityType>;
642
648
  /** Provides information about the fields of the Repository's entity
643
649
  * @example
644
- * console.log(repo.fields.title.caption) // displays the caption of a specific field
650
+ * console.log(repo.fields.title.label) // displays the label of a specific field
645
651
  * console.log(repo.fields.title.options)// writes the options that were defined for this field
646
652
  */
647
653
  fields: FieldsMetadata<entityType>;
@@ -1129,7 +1135,7 @@ export type Paginator<entityType, AggregateResult = EmptyAggregateResult> = {
1129
1135
  * @template matchIdEntity The type used for matching IDs in the relation.
1130
1136
  * @template optionsType The type of find options to apply to the relation (default is FindOptionsBase<toEntity>).
1131
1137
  */
1132
- export interface RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> extends Pick<FieldOptions, 'caption'> {
1138
+ export interface RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> extends Pick<FieldOptions, 'caption' | 'label'> {
1133
1139
  /**
1134
1140
  * An object specifying custom field names for the relation.
1135
1141
  * Each key represents a field in the related entity, and its value is the corresponding field in the source entity.