Skip to content

Commit

Permalink
refactor: Put shared count and query args into DynamoQueryArgs type
Browse files Browse the repository at this point in the history
  • Loading branch information
cyungslack committed Mar 11, 2024
1 parent 3b1d1ba commit 3ea0b53
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions src/typed-method-types/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ import {
} from "../types.ts";

// apps.datastore Types
type DynamoQueryArgs = {
/**
* @description A query filter expression
* @see {@link https://api.slack.com/automation/datastores-retrieve#filter-expressions}.
*/
expression?: string;
/**
* @description A map of attributes referenced in `expression`
*/
"expression_attributes"?: Record<string, string>;
/**
* @description A map of values referenced in `expression`
*/
"expression_values"?: Record<string, string | boolean | number>;
};

export type DatastoreSchema = {
name: string;
// deno-lint-ignore no-explicit-any
Expand Down Expand Up @@ -182,24 +198,12 @@ export type DatastoreQueryArgs<
> =
& BaseMethodArgs
& CursorPaginationArgs
& DynamoQueryArgs
& {
/**
* @description The name of the datastore
*/
datastore: Schema["name"];
/**
* @description A query filter expression
* @see {@link https://api.slack.com/automation/datastores-retrieve#filter-expressions}.
*/
expression?: string;
/**
* @description A map of attributes referenced in expression
*/
"expression_attributes"?: Record<string, string>;
/**
* @description A map of values referenced in expression
*/
"expression_values"?: Record<string, string | boolean | number>;
};

export type DatastoreQueryResponse<
Expand All @@ -222,24 +226,12 @@ export type DatastoreCountArgs<
Schema extends DatastoreSchema,
> =
& BaseMethodArgs
& DynamoQueryArgs
& {
/**
* @description The name of the datastore
*/
datastore: Schema["name"];
/**
* @description A query filter expression
* @see {@link https://api.slack.com/automation/datastores-retrieve#filter-expressions}.
*/
expression?: string;
/**
* @description A map of attributes referenced in expression
*/
"expression_attributes"?: Record<string, string>;
/**
* @description A map of values referenced in expression
*/
"expression_values"?: Record<string, string | boolean | number>;
};

export type DatastoreCountResponse<
Expand Down

0 comments on commit 3ea0b53

Please sign in to comment.