Skip to content

Commit

Permalink
Revert "feat: Add datastore count API (#93)" (#95)
Browse files Browse the repository at this point in the history
This reverts commit 185ddda.
  • Loading branch information
filmaj authored Mar 15, 2024
1 parent 185ddda commit 003320d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 52 deletions.
53 changes: 3 additions & 50 deletions src/typed-method-types/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<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 @@ -198,12 +182,14 @@ export type DatastoreQueryArgs<
> =
& BaseMethodArgs
& CursorPaginationArgs
& DynamoQueryArgs
& {
/**
* @description The name of the datastore
*/
datastore: Schema["name"];
expression?: string;
"expression_attributes"?: Record<string, string>;
"expression_values"?: Record<string, string | boolean | number>;
};

export type DatastoreQueryResponse<
Expand All @@ -222,33 +208,6 @@ export type DatastoreQueryResponse<
items: DatastoreItem<Schema>[];
};

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,
> =
Expand Down Expand Up @@ -334,11 +293,6 @@ export type AppsDatastoreQuery = {
args: DatastoreQueryArgs<Schema>,
): Promise<DatastoreQueryResponse<Schema>>;
};
export type AppsDatastoreCount = {
<Schema extends DatastoreSchema>(
args: DatastoreCountArgs<Schema>,
): Promise<DatastoreCountResponse<Schema>>;
};
export type AppsDatastoreDelete = {
<Schema extends DatastoreSchema>(
args: DatastoreDeleteArgs<Schema>,
Expand Down Expand Up @@ -414,7 +368,6 @@ export type TypedAppsMethodTypes = {
bulkPut: AppsDatastoreBulkPut;
update: AppsDatastoreUpdate;
query: AppsDatastoreQuery;
count: AppsDatastoreCount;
delete: AppsDatastoreDelete;
bulkDelete: AppsDatastoreBulkDelete;
};
Expand Down
1 change: 0 additions & 1 deletion src/typed-method-types/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/typed-method-types/typed-method-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 003320d

Please sign in to comment.