From 3ea0b532a6b1e189bd6a232813e70b242062ab70 Mon Sep 17 00:00:00 2001 From: Cara Yung Date: Mon, 11 Mar 2024 16:05:07 -0400 Subject: [PATCH] refactor: Put shared count and query args into DynamoQueryArgs type --- src/typed-method-types/apps.ts | 44 ++++++++++++++-------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/typed-method-types/apps.ts b/src/typed-method-types/apps.ts index e62fb51..0e4f836 100644 --- a/src/typed-method-types/apps.ts +++ b/src/typed-method-types/apps.ts @@ -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; + /** + * @description A map of values referenced in `expression` + */ + "expression_values"?: Record; +}; + export type DatastoreSchema = { name: string; // deno-lint-ignore no-explicit-any @@ -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; - /** - * @description A map of values referenced in expression - */ - "expression_values"?: Record; }; export type DatastoreQueryResponse< @@ -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; - /** - * @description A map of values referenced in expression - */ - "expression_values"?: Record; }; export type DatastoreCountResponse<