electrodb 1.4.0 → 1.4.4

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/index.d.ts CHANGED
@@ -77,7 +77,7 @@ type NestedStringAttribute = {
77
77
  readonly get?: (val: string, item: any) => string | undefined | void;
78
78
  readonly set?: (val?: string, item?: any) => string | undefined | void;
79
79
  readonly default?: string | (() => string);
80
- readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void);
80
+ readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void) | RegExp;
81
81
  readonly field?: string;
82
82
  }
83
83
 
@@ -89,7 +89,7 @@ type StringAttribute = {
89
89
  readonly get?: (val: string, item: any) => string | undefined | void;
90
90
  readonly set?: (val?: string, item?: any) => string | undefined | void;
91
91
  readonly default?: string | (() => string);
92
- readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void);
92
+ readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void) | RegExp;
93
93
  readonly field?: string;
94
94
  readonly label?: string;
95
95
  readonly watch?: ReadonlyArray<string> | "*";
@@ -190,7 +190,7 @@ type NestedStringListAttribute = {
190
190
  readonly get?: (val: string, item: any) => string | undefined | void;
191
191
  readonly set?: (val?: string, item?: any) => string | undefined | void;
192
192
  readonly default?: string | (() => string);
193
- readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void);
193
+ readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void) | RegExp;
194
194
  readonly field?: string;
195
195
  };
196
196
  readonly required?: boolean;
@@ -212,7 +212,7 @@ type StringListAttribute = {
212
212
  readonly get?: (val: string, item: any) => string | undefined | void;
213
213
  readonly set?: (val?: string, item?: any) => string | undefined | void;
214
214
  readonly default?: string | (() => string);
215
- readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void);
215
+ readonly validate?: ((val: string) => boolean) | ((val: string) => void) | ((val: string) => string | void) | RegExp;
216
216
  readonly field?: string;
217
217
  }
218
218
  readonly required?: boolean;
@@ -288,7 +288,7 @@ type NestedStringSetAttribute = {
288
288
  readonly get?: (val: Array<string>, item: any) => Array<string> | undefined | void;
289
289
  readonly set?: (val?: Array<string>, item?: any) => Array<string> | undefined | void;
290
290
  readonly default?: Array<string> | (() => Array<string>);
291
- readonly validate?: ((val: Array<string>) => boolean) | ((val: Array<string>) => void) | ((val: Array<string>) => string | void);
291
+ readonly validate?: ((val: Array<string>) => boolean) | ((val: Array<string>) => void) | ((val: Array<string>) => string | void) | RegExp;
292
292
  readonly field?: string;
293
293
  }
294
294
 
@@ -301,7 +301,7 @@ type StringSetAttribute = {
301
301
  readonly get?: (val: Array<string>, item: any) => Array<string> | undefined | void;
302
302
  readonly set?: (val?: Array<string>, item?: any) => Array<string> | undefined | void;
303
303
  readonly default?: Array<string> | (() => Array<string>);
304
- readonly validate?: ((val: Array<string>) => boolean) | ((val: Array<string>) => void) | ((val: Array<string>) => string | void);
304
+ readonly validate?: ((val: Array<string>) => boolean) | ((val: Array<string>) => void) | ((val: Array<string>) => string | void) | RegExp;
305
305
  readonly field?: string;
306
306
  readonly watch?: ReadonlyArray<string> | "*";
307
307
  }
@@ -955,6 +955,7 @@ interface PutQueryOptions extends QueryOptions {
955
955
  interface ParamOptions {
956
956
  params?: object;
957
957
  table?: string;
958
+ limit?: number;
958
959
  response?: "default" | "none" | 'all_old' | 'updated_old' | 'all_new' | 'updated_new';
959
960
  }
960
961
 
@@ -1052,7 +1053,7 @@ type Queries<A extends string, F extends A, C extends string, S extends Schema<A
1052
1053
  IndexSKAttributes<A,F,C,S,I> extends infer SK
1053
1054
  // If there is no SK, dont show query operations (when an empty array is provided)
1054
1055
  ? [keyof SK] extends [never]
1055
- ? RecordsActionOptions<A,F,C,S, ResponseItem<A,F,C,S>[], AllTableIndexCompositeAttributes<A,F,C,S>>
1056
+ ? RecordsActionOptions<A,F,C,S, ResponseItem<A,F,C,S>[], AllTableIndexCompositeAttributes<A,F,C,S> & Required<CompositeAttributes>>
1056
1057
  // If there is no SK, dont show query operations (When no PK is specified)
1057
1058
  : S["indexes"][I] extends IndexWithSortKey
1058
1059
  ? QueryOperations<
@@ -1060,9 +1061,9 @@ type Queries<A extends string, F extends A, C extends string, S extends Schema<A
1060
1061
  // Omit the composite attributes already provided
1061
1062
  Omit<Partial<IndexSKAttributes<A,F,C,S,I>>, keyof CompositeAttributes>,
1062
1063
  ResponseItem<A,F,C,S>,
1063
- AllTableIndexCompositeAttributes<A,F,C,S>
1064
+ AllTableIndexCompositeAttributes<A,F,C,S> & Required<CompositeAttributes> & SK
1064
1065
  >
1065
- : RecordsActionOptions<A,F,C,S, ResponseItem<A,F,C,S>[], AllTableIndexCompositeAttributes<A,F,C,S>>
1066
+ : RecordsActionOptions<A,F,C,S, ResponseItem<A,F,C,S>[], AllTableIndexCompositeAttributes<A,F,C,S> & Required<CompositeAttributes> & SK>
1066
1067
  : never
1067
1068
  }
1068
1069