-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #621 from jeremydaly/finish-implementing-scan-comm…
…ands-for-good Finish implementing scan commands for good
- Loading branch information
Showing
11 changed files
with
232 additions
and
40 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
import type { CapacityOption } from 'v1/commands/constants/options/capacity' | ||
import type { Condition } from 'v1/commands/types/condition' | ||
import type { AnyAttributePath, Condition } from 'v1/commands/types' | ||
import type { EntityV2 } from 'v1/entity' | ||
|
||
import type { SelectOption } from './constants' | ||
import type { | ||
SelectOption, | ||
AllProjectedAttributesSelectOption, | ||
SpecificAttributesSelectOption | ||
} from './constants' | ||
|
||
export type ScanOptions<ENTITIES extends EntityV2 = EntityV2> = { | ||
capacity?: CapacityOption | ||
consistent?: boolean | ||
exclusiveStartKey?: Record<string, unknown> | ||
indexName?: string | ||
limit?: number | ||
select?: SelectOption | ||
filters?: EntityV2 extends ENTITIES | ||
? Record<string, Condition> | ||
: { [ENTITY in ENTITIES as ENTITY['name']]: Condition<ENTITY> } | ||
: { [ENTITY in ENTITIES as ENTITY['name']]?: Condition<ENTITY> } | ||
} & ( | ||
| { segment?: never; totalSegments?: never } | ||
// Either both segment & totalSegments are set, either none | ||
} & ({ segment?: never; totalSegments?: never } | { segment: number; totalSegments: number }) | ||
| { segment: number; totalSegments: number } | ||
) & | ||
( | ||
| { select?: Exclude<SelectOption, AllProjectedAttributesSelectOption>; indexName?: string } | ||
// "ALL_PROJECTED_ATTRIBUTES" is only available if indexName is present | ||
| { select?: SelectOption; indexName: string } | ||
) & | ||
( | ||
| { attributes?: undefined; select?: SelectOption } | ||
// "SPECIFIC_ATTRIBUTES" is the only valid option if projectionExpression is present | ||
| { | ||
attributes: EntityV2 extends ENTITIES | ||
? Record<string, Condition> | ||
: { [ENTITY in ENTITIES as ENTITY['name']]?: AnyAttributePath<ENTITY>[] } | ||
select?: SpecificAttributesSelectOption | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.