@wix/himalaya-cli 0.1431.0 → 0.1433.0

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.
@@ -63,17 +63,25 @@ export declare const auth: {
63
63
  /** Drop the stored token. Later entity calls run anonymously (public data only). */
64
64
  logout(): Promise<void>;
65
65
  };
66
- export interface EntityHandle {
67
- list(opts?: ListOptions): Promise<Base44Row[]>;
68
- filter(query: JsonObject, opts?: ListOptions): Promise<Base44Row[]>;
69
- get(id: string): Promise<Base44Row>;
70
- create(data: JsonObject): Promise<Base44Row>;
71
- update(id: string, patch: JsonObject): Promise<Base44Row>;
66
+ /**
67
+ * One entity's verbs. `T` is the row shape: `Base44Row` (untyped) unless the caller names one,
68
+ * e.g. a row type generated by `himi base44 types`. A row type must be a type alias, not an
69
+ * `interface` — only an alias satisfies `Base44Row`'s `JsonObject` index signature.
70
+ */
71
+ export interface EntityHandle<T extends Base44Row = Base44Row> {
72
+ list(opts?: ListOptions): Promise<T[]>;
73
+ filter(query: JsonObject, opts?: ListOptions): Promise<T[]>;
74
+ get(id: string): Promise<T>;
75
+ create(data: Partial<T>): Promise<T>;
76
+ update(id: string, patch: Partial<T>): Promise<T>;
72
77
  delete(id: string): Promise<void>;
73
- bulkCreate(rows: JsonObject[]): Promise<Base44Row[]>;
78
+ bulkCreate(rows: Partial<T>[]): Promise<T[]>;
74
79
  }
75
- /** Typed access to one entity of the configured Base44 app, e.g. `entities("Task").list()`. */
76
- export declare function entities(name: string): EntityHandle;
80
+ /**
81
+ * Typed access to one entity of the configured Base44 app, e.g. `entities("Task").list()`.
82
+ * Pass a row type to type the rows: `entities<TaskRow>("Task")`. Types only — runtime is identical.
83
+ */
84
+ export declare function entities<T extends Base44Row = Base44Row>(name: string): EntityHandle<T>;
77
85
  export declare const functions: {
78
86
  /** Invoke a Base44 backend function by name. Resolves with its JSON reply. */
79
87
  invoke(name: string, data?: JsonObject): Promise<Json>;