From 003320d0afd16fcf0d2c550970dac044fa33d05b Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Fri, 15 Mar 2024 13:26:41 -0400 Subject: [PATCH] Revert "feat: Add datastore count API (#93)" (#95) This reverts commit 185dddafe501333a052971a1747a840b59508773. --- src/typed-method-types/apps.ts | 53 ++------------------ src/typed-method-types/mod.ts | 1 - src/typed-method-types/typed-method-tests.ts | 1 - 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/src/typed-method-types/apps.ts b/src/typed-method-types/apps.ts index 0e4f836..3a023fc 100644 --- a/src/typed-method-types/apps.ts +++ b/src/typed-method-types/apps.ts @@ -6,22 +6,6 @@ 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 @@ -198,12 +182,14 @@ export type DatastoreQueryArgs< > = & BaseMethodArgs & CursorPaginationArgs - & DynamoQueryArgs & { /** * @description The name of the datastore */ datastore: Schema["name"]; + expression?: string; + "expression_attributes"?: Record; + "expression_values"?: Record; }; export type DatastoreQueryResponse< @@ -222,33 +208,6 @@ export type DatastoreQueryResponse< items: DatastoreItem[]; }; -export type DatastoreCountArgs< - Schema extends DatastoreSchema, -> = - & BaseMethodArgs - & DynamoQueryArgs - & { - /** - * @description The name of the datastore - */ - datastore: Schema["name"]; - }; - -export type DatastoreCountResponse< - Schema extends DatastoreSchema, -> = - & BaseResponse - & { - /** - * @description The name of the datastore - */ - datastore: Schema["name"]; - /** - * @description The number of items matching your query - */ - count: number; - }; - export type DatastoreDeleteArgs< Schema extends DatastoreSchema, > = @@ -334,11 +293,6 @@ export type AppsDatastoreQuery = { args: DatastoreQueryArgs, ): Promise>; }; -export type AppsDatastoreCount = { - ( - args: DatastoreCountArgs, - ): Promise>; -}; export type AppsDatastoreDelete = { ( args: DatastoreDeleteArgs, @@ -414,7 +368,6 @@ export type TypedAppsMethodTypes = { bulkPut: AppsDatastoreBulkPut; update: AppsDatastoreUpdate; query: AppsDatastoreQuery; - count: AppsDatastoreCount; delete: AppsDatastoreDelete; bulkDelete: AppsDatastoreBulkDelete; }; diff --git a/src/typed-method-types/mod.ts b/src/typed-method-types/mod.ts index c01f3b3..3c89b94 100644 --- a/src/typed-method-types/mod.ts +++ b/src/typed-method-types/mod.ts @@ -20,7 +20,6 @@ export const methodsWithCustomTypes = [ "apps.datastore.bulkPut", "apps.datastore.update", "apps.datastore.query", - "apps.datastore.count", "apps.auth.external.get", "apps.auth.external.delete", "chat.postMessage", diff --git a/src/typed-method-types/typed-method-tests.ts b/src/typed-method-types/typed-method-tests.ts index ee6ac9f..8fe867a 100644 --- a/src/typed-method-types/typed-method-tests.ts +++ b/src/typed-method-types/typed-method-tests.ts @@ -12,7 +12,6 @@ Deno.test("Custom Type Methods are valid functions", () => { assertEquals(typeof client.apps.datastore.bulkPut, "function"); assertEquals(typeof client.apps.datastore.update, "function"); assertEquals(typeof client.apps.datastore.query, "function"); - assertEquals(typeof client.apps.datastore.count, "function"); assertEquals(typeof client.apps.auth.external.get, "function"); assertEquals(typeof client.apps.auth.external.delete, "function"); assertEquals(typeof client.workflows.triggers.create, "function");