@yrest/cli 0.10.0 → 0.11.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/dist/index.d.mts CHANGED
@@ -80,11 +80,17 @@ type Data = Record<string, Resource[]>;
80
80
  type RelationDef = {
81
81
  type: "many2one";
82
82
  target: string;
83
+ foreignKey?: string;
83
84
  nested?: boolean;
85
+ carDirect?: string;
86
+ carInverse?: string;
84
87
  } | {
85
88
  type: "one2one";
86
89
  target: string;
90
+ foreignKey?: string;
87
91
  nested?: boolean;
92
+ carDirect?: string;
93
+ carInverse?: string;
88
94
  } | {
89
95
  type: "many2many";
90
96
  target: string;
@@ -92,6 +98,8 @@ type RelationDef = {
92
98
  foreignKey: string;
93
99
  otherKey: string;
94
100
  nested?: boolean;
101
+ carDirect?: string;
102
+ carInverse?: string;
95
103
  };
96
104
  /**
97
105
  * Relational mappings declared under `_rel` in the YAML file, normalised to {@link RelationDef}.
@@ -525,16 +533,6 @@ type YrestServerOptions = YrestServerBaseOptions & ({
525
533
  */
526
534
  declare function createYrestServer(options: YrestServerOptions): YrestServer;
527
535
 
528
- /**
529
- * Creates a {@link YrestStorage} instance backed by the given YAML file.
530
- *
531
- * The file is read and parsed eagerly on construction. The `_rel` key is
532
- * extracted as relational metadata; `_routes` as custom route declarations;
533
- * all other top-level keys become collections.
534
- *
535
- * @param filePath - Relative or absolute path to the YAML database file.
536
- * @throws {Error} If the file cannot be read or its YAML is invalid.
537
- */
538
536
  declare function createYrestStorage(filePath: string): YrestStorage;
539
537
 
540
538
  export { type CustomRoute, type Data, type Handler, type HandlerMap, type HandlerRequest, type HandlerResponse, type Relations, type Resource, type YrestOptions, type YrestServer, type YrestServerBaseOptions, type YrestServerOptions, type YrestStorage, createServer, createYrestServer, createYrestServerFromStorage, createYrestStorage, yrest, yrestOptionsSchema };
package/dist/index.d.ts CHANGED
@@ -80,11 +80,17 @@ type Data = Record<string, Resource[]>;
80
80
  type RelationDef = {
81
81
  type: "many2one";
82
82
  target: string;
83
+ foreignKey?: string;
83
84
  nested?: boolean;
85
+ carDirect?: string;
86
+ carInverse?: string;
84
87
  } | {
85
88
  type: "one2one";
86
89
  target: string;
90
+ foreignKey?: string;
87
91
  nested?: boolean;
92
+ carDirect?: string;
93
+ carInverse?: string;
88
94
  } | {
89
95
  type: "many2many";
90
96
  target: string;
@@ -92,6 +98,8 @@ type RelationDef = {
92
98
  foreignKey: string;
93
99
  otherKey: string;
94
100
  nested?: boolean;
101
+ carDirect?: string;
102
+ carInverse?: string;
95
103
  };
96
104
  /**
97
105
  * Relational mappings declared under `_rel` in the YAML file, normalised to {@link RelationDef}.
@@ -525,16 +533,6 @@ type YrestServerOptions = YrestServerBaseOptions & ({
525
533
  */
526
534
  declare function createYrestServer(options: YrestServerOptions): YrestServer;
527
535
 
528
- /**
529
- * Creates a {@link YrestStorage} instance backed by the given YAML file.
530
- *
531
- * The file is read and parsed eagerly on construction. The `_rel` key is
532
- * extracted as relational metadata; `_routes` as custom route declarations;
533
- * all other top-level keys become collections.
534
- *
535
- * @param filePath - Relative or absolute path to the YAML database file.
536
- * @throws {Error} If the file cannot be read or its YAML is invalid.
537
- */
538
536
  declare function createYrestStorage(filePath: string): YrestStorage;
539
537
 
540
538
  export { type CustomRoute, type Data, type Handler, type HandlerMap, type HandlerRequest, type HandlerResponse, type Relations, type Resource, type YrestOptions, type YrestServer, type YrestServerBaseOptions, type YrestServerOptions, type YrestStorage, createServer, createYrestServer, createYrestServerFromStorage, createYrestStorage, yrest, yrestOptionsSchema };