electrodb 2.2.1 → 2.2.2

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 +11 -7
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -723,7 +723,7 @@ export interface BatchWriteOperationOptions<A extends string, F extends string,
723
723
  }
724
724
 
725
725
  export interface SetRecordActionOptions<A extends string, F extends string, C extends string, S extends Schema<A,F,C>, SetAttr,IndexCompositeAttributes,TableItem> {
726
- go: UpdateRecordGo<Partial<TableItem>, UpdateQueryOptions>;
726
+ go: UpdateRecordGo<TableItem>;
727
727
  params: ParamRecord<UpdateQueryParams>;
728
728
  set: SetRecord<A,F,C,S, SetItem<A,F,C,S>,IndexCompositeAttributes,TableItem>;
729
729
  remove: SetRecord<A,F,C,S, Array<keyof SetItem<A,F,C,S>>,IndexCompositeAttributes,TableItem>;
@@ -987,7 +987,16 @@ export type ServiceQueryRecordsGo<ResponseType, Options = QueryOptions> = <T = R
987
987
 
988
988
  export type QueryRecordsGo<ResponseType, Options = QueryOptions> = <T = ResponseType>(options?: Options) => Promise<{ data: T, cursor: string | null }>;
989
989
 
990
- export type UpdateRecordGo<ResponseType, Options = QueryOptions> = <T = ResponseType>(options?: Options) => Promise<{ data: T }>;
990
+ export type UpdateRecordGo<ResponseType> = <T = ResponseType, Options extends UpdateQueryOptions = UpdateQueryOptions>(options?: Options) =>
991
+ Options extends infer O
992
+ ? 'response' extends keyof O
993
+ ? O['response'] extends 'all_new'
994
+ ? Promise<{data: T}>
995
+ : O['response'] extends 'all_old'
996
+ ? Promise<{data: T}>
997
+ : Promise<{data: Partial<T>}>
998
+ : Promise<{data: Partial<T>}>
999
+ : never;
991
1000
 
992
1001
  export type PutRecordGo<ResponseType, Options = QueryOptions> = <T = ResponseType>(options?: Options) => Promise<{ data: T }>;
993
1002
 
@@ -996,11 +1005,6 @@ export type DeleteRecordOperationGo<ResponseType, Options = QueryOptions> = <T =
996
1005
  export type BatchWriteGo<ResponseType> = <O extends BulkOptions>(options?: O) =>
997
1006
  Promise<{ unprocessed: ResponseType }>
998
1007
 
999
- // export type PageRecord<ResponseType, CompositeAttributes> = (page?: (CompositeAttributes & OptionalDefaultEntityIdentifiers) | null, options?: PaginationOptions) => Promise<[
1000
- // (CompositeAttributes & OptionalDefaultEntityIdentifiers) | null,
1001
- // ResponseType
1002
- // ]>;
1003
-
1004
1008
  export type ParamRecord<Options = ParamOptions> = <P>(options?: Options) => P;
1005
1009
 
1006
1010
  export class ElectroError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrodb",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
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": {