From 9a79933d9fe41494c8970ae0e1105ea2f061740d Mon Sep 17 00:00:00 2001 From: Jon Grim Date: Fri, 13 Sep 2024 09:37:09 +0200 Subject: [PATCH] trim discord text (#275) * trim discord text * run the typings command --- .../api/src/handlers/execute-integration.ts | 5 +- infrastructure/api/template.yaml | 2 +- src/typings/supabase.ts | 138 +++++++++++++++++- 3 files changed, 142 insertions(+), 3 deletions(-) diff --git a/infrastructure/api/src/handlers/execute-integration.ts b/infrastructure/api/src/handlers/execute-integration.ts index dc807df..80d78a5 100644 --- a/infrastructure/api/src/handlers/execute-integration.ts +++ b/infrastructure/api/src/handlers/execute-integration.ts @@ -36,7 +36,10 @@ export const processGameIntegration = async (event: SNSEvent) => { text: "New game added to Playabl", creator: data?.username, name: entity.title, - description: entity.description_as_flat_text, + description: + entity.description_as_flat_text.length > 2048 + ? entity.description_as_flat_text.substring(0, 2040).concat("...") + : entity.description_as_flat_text, url: `https://app.playabl.io/games/${entity.id}`, imageUrl: publicUrl, }); diff --git a/infrastructure/api/template.yaml b/infrastructure/api/template.yaml index 32d270e..2e0c665 100644 --- a/infrastructure/api/template.yaml +++ b/infrastructure/api/template.yaml @@ -4,7 +4,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: CodeUri: ./src - Runtime: nodejs16.x + Runtime: nodejs20.x MemorySize: 128 Resources: diff --git a/src/typings/supabase.ts b/src/typings/supabase.ts index 1b440e3..ed2e17a 100644 --- a/src/typings/supabase.ts +++ b/src/typings/supabase.ts @@ -972,6 +972,7 @@ export type Database = { owner_id: string | null path_tokens: string[] | null updated_at: string | null + user_metadata: Json | null version: string | null } Insert: { @@ -985,6 +986,7 @@ export type Database = { owner_id?: string | null path_tokens?: string[] | null updated_at?: string | null + user_metadata?: Json | null version?: string | null } Update: { @@ -998,6 +1000,7 @@ export type Database = { owner_id?: string | null path_tokens?: string[] | null updated_at?: string | null + user_metadata?: Json | null version?: string | null } Relationships: [ @@ -1010,6 +1013,104 @@ export type Database = { }, ] } + s3_multipart_uploads: { + Row: { + bucket_id: string + created_at: string + id: string + in_progress_size: number + key: string + owner_id: string | null + upload_signature: string + user_metadata: Json | null + version: string + } + Insert: { + bucket_id: string + created_at?: string + id: string + in_progress_size?: number + key: string + owner_id?: string | null + upload_signature: string + user_metadata?: Json | null + version: string + } + Update: { + bucket_id?: string + created_at?: string + id?: string + in_progress_size?: number + key?: string + owner_id?: string | null + upload_signature?: string + user_metadata?: Json | null + version?: string + } + Relationships: [ + { + foreignKeyName: "s3_multipart_uploads_bucket_id_fkey" + columns: ["bucket_id"] + isOneToOne: false + referencedRelation: "buckets" + referencedColumns: ["id"] + }, + ] + } + s3_multipart_uploads_parts: { + Row: { + bucket_id: string + created_at: string + etag: string + id: string + key: string + owner_id: string | null + part_number: number + size: number + upload_id: string + version: string + } + Insert: { + bucket_id: string + created_at?: string + etag: string + id?: string + key: string + owner_id?: string | null + part_number: number + size?: number + upload_id: string + version: string + } + Update: { + bucket_id?: string + created_at?: string + etag?: string + id?: string + key?: string + owner_id?: string | null + part_number?: number + size?: number + upload_id?: string + version?: string + } + Relationships: [ + { + foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey" + columns: ["bucket_id"] + isOneToOne: false + referencedRelation: "buckets" + referencedColumns: ["id"] + }, + { + foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey" + columns: ["upload_id"] + isOneToOne: false + referencedRelation: "s3_multipart_uploads" + referencedColumns: ["id"] + }, + ] + } } Views: { [_ in never]: never @@ -1040,7 +1141,7 @@ export type Database = { Args: { name: string } - Returns: unknown + Returns: string[] } get_size_by_bucket: { Args: Record @@ -1049,6 +1150,41 @@ export type Database = { bucket_id: string }[] } + list_multipart_uploads_with_delimiter: { + Args: { + bucket_id: string + prefix_param: string + delimiter_param: string + max_keys?: number + next_key_token?: string + next_upload_token?: string + } + Returns: { + key: string + id: string + created_at: string + }[] + } + list_objects_with_delimiter: { + Args: { + bucket_id: string + prefix_param: string + delimiter_param: string + max_keys?: number + start_after?: string + next_token?: string + } + Returns: { + name: string + id: string + metadata: Json + updated_at: string + }[] + } + operation: { + Args: Record + Returns: string + } search: { Args: { prefix: string