remult 0.27.2-next.0 → 0.27.3

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/README.md CHANGED
@@ -41,6 +41,8 @@ Remult uses **TypeScript entities** as a single source of truth for: ✅ CRUD +
41
41
 
42
42
  **Remult is frontend and backend framework agnostic** and comes with adapters for Express, Fastify, Next.js, Nuxt, SvelteKit, SolidStart, Nest, Koa, Hapi and Hono.
43
43
 
44
+ > **Want to experience Remult firsthand? [Try our interactive online tutorial](https://learn.remult.dev/).**
45
+
44
46
  Remult promotes a **consistent query syntax for both frontend and Backend code**:
45
47
 
46
48
  ```ts
@@ -303,6 +303,7 @@ export class RemultServerImplementation {
303
303
  else
304
304
  await this.runWithRemult(async (remult) => {
305
305
  if (req) {
306
+ ;
306
307
  remult.context.request = req;
307
308
  remultStatic.asyncContext.setInInitRequest(true);
308
309
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.27.2-next.0",
3
+ "version": "0.27.3",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -590,6 +590,7 @@ var RemultServerImplementation = /** @class */ (function () {
590
590
  switch (_a.label) {
591
591
  case 0:
592
592
  if (!req) return [3 /*break*/, 8];
593
+ ;
593
594
  remult.context.request = req;
594
595
  remult_static_js_1.remultStatic.asyncContext.setInInitRequest(true);
595
596
  _a.label = 1;
package/src/context.d.ts CHANGED
@@ -85,22 +85,17 @@ export declare class Remult {
85
85
  export type GetArguments<T> = T extends (...args: infer FirstArgument) => any ? FirstArgument : never;
86
86
  /**
87
87
  * This type represents the context object available through `remult.context`
88
- * It can be used to store custom information that will be available throughout the request lifecycle.
88
+ * If its used within the request lifecycle it's `request` member will be set automatically.
89
+ * To type it correctly, you can extend it with your own properties.
89
90
  * @example
90
- * remult.context.myCustomData = 'hello'
91
- */
91
+ * import type express from 'express'
92
+ * declare module 'remult' {
93
+ * export interface RemultContext {
94
+ * request?: express.Request
95
+ * }
96
+ * }
97
+ * */
92
98
  export interface RemultContext {
93
- /** When running on the backend as part of a request, will have the request object.
94
- * You can type it to your specific type
95
- * @example
96
- * import type express from 'express'
97
- * declare module 'remult' {
98
- * export interface RemultContext {
99
- * request?: express.Request
100
- * }
101
- * }
102
- * */
103
- request?: unknown;
104
99
  }
105
100
  /**
106
101
  * Interface for configuring the API client used by Remult to perform HTTP calls to the backend.
@@ -838,7 +838,7 @@ export interface Paginator<entityType> {
838
838
  * @template matchIdEntity The type used for matching IDs in the relation.
839
839
  * @template optionsType The type of find options to apply to the relation (default is FindOptionsBase<toEntity>).
840
840
  */
841
- export type RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> = {
841
+ export interface RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> extends Pick<FieldOptions, 'caption'> {
842
842
  /**
843
843
  * An object specifying custom field names for the relation.
844
844
  * Each key represents a field in the related entity, and its value is the corresponding field in the source entity.
@@ -865,7 +865,7 @@ export type RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType ext
865
865
  * If false or not specified, related entities will need to be explicitly included using the `include` option.
866
866
  */
867
867
  defaultIncluded?: boolean;
868
- } & Pick<FieldOptions, 'caption'>;
868
+ }
869
869
  export type ObjectMembersOnly<T> = MembersOnly<{
870
870
  [K in keyof Pick<T, {
871
871
  [K in keyof T]: T[K] extends object | undefined | null ? T[K] extends Date | undefined | null ? never : K : never;