electrodb 3.4.2 → 3.4.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.
Files changed (2) hide show
  1. package/index.d.ts +15 -10
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1236,10 +1236,10 @@ export interface RecordsActionOptions<
1236
1236
  F extends string,
1237
1237
  C extends string,
1238
1238
  S extends Schema<A, F, C>,
1239
- Items,
1239
+ ResponseItem,
1240
1240
  IndexCompositeAttributes,
1241
1241
  > {
1242
- go: QueryRecordsGo<Items>;
1242
+ go: QueryRecordsGo<ResponseItem>;
1243
1243
  params: ParamRecord;
1244
1244
  where: WhereClause<
1245
1245
  A,
@@ -1247,7 +1247,7 @@ export interface RecordsActionOptions<
1247
1247
  C,
1248
1248
  S,
1249
1249
  Item<A, F, C, S, S["attributes"]>,
1250
- RecordsActionOptions<A, F, C, S, Items, IndexCompositeAttributes>
1250
+ RecordsActionOptions<A, F, C, S, ResponseItem, IndexCompositeAttributes>
1251
1251
  >;
1252
1252
  }
1253
1253
 
@@ -2854,11 +2854,16 @@ export type ServiceQueryRecordsGo<
2854
2854
  options?: Options,
2855
2855
  ) => Promise<{ data: T; cursor: string | null }>;
2856
2856
 
2857
- export type QueryRecordsGo<ResponseType, Options = QueryOptions> = <
2858
- T = ResponseType,
2859
- >(
2857
+ export type QueryRecordsGo<Item> = <Options extends GoQueryTerminalOptions<keyof Item>>(
2860
2858
  options?: Options,
2861
- ) => Promise<{ data: T; cursor: string | null }>;
2859
+ ) => Options extends GoQueryTerminalOptions<infer Attr>
2860
+ ? Promise<{
2861
+ data: Array<{
2862
+ [Name in keyof Item as Name extends Attr ? Name : never]: Item[Name];
2863
+ }>;
2864
+ cursor: string | null;
2865
+ }>
2866
+ : Promise<{ data: Array<Item>; cursor: string | null }>;
2862
2867
 
2863
2868
  export type UpdateRecordGo<ResponseType, Keys> = <
2864
2869
  T = ResponseType,
@@ -5254,7 +5259,7 @@ export class Entity<
5254
5259
  F,
5255
5260
  C,
5256
5261
  S,
5257
- ResponseItem<A, F, C, S>[],
5262
+ ResponseItem<A, F, C, S>,
5258
5263
  AllTableIndexCompositeAttributes<A, F, C, S>
5259
5264
  >;
5260
5265
 
@@ -5265,7 +5270,7 @@ export class Entity<
5265
5270
  F,
5266
5271
  C,
5267
5272
  S,
5268
- ResponseItem<A, F, C, S>[],
5273
+ ResponseItem<A, F, C, S>,
5269
5274
  AllTableIndexCompositeAttributes<A, F, C, S>
5270
5275
  >;
5271
5276
 
@@ -5274,7 +5279,7 @@ export class Entity<
5274
5279
  F,
5275
5280
  C,
5276
5281
  S,
5277
- ResponseItem<A, F, C, S>[],
5282
+ ResponseItem<A, F, C, S>,
5278
5283
  TableIndexCompositeAttributes<A, F, C, S>
5279
5284
  >;
5280
5285
  query: Queries<A, F, C, S>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrodb",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "A library to more easily create and interact with multiple entities and heretical relationships in dynamodb",
5
5
  "main": "index.js",
6
6
  "scripts": {