From 50e31dd74ba72e0db56d4e7a97f23f92b41bc1cf Mon Sep 17 00:00:00 2001 From: kainpets Date: Wed, 15 May 2024 11:54:35 +0200 Subject: [PATCH 1/6] add optional chaining --- lib/interact-for-access-code.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/interact-for-access-code.ts b/lib/interact-for-access-code.ts index 77c264d..04ffa81 100644 --- a/lib/interact-for-access-code.ts +++ b/lib/interact-for-access-code.ts @@ -22,9 +22,9 @@ export const interactForAccessCode = async ({ type: "autocomplete", message: "Select an access_code:", choices: accessCodes.map((ac: any) => ({ - title: ac.properties.name ?? "", - value: ac.access_code_id, - description: `${ac.type} ${ac.access_code_id}`, + title: ac?.properties?.name ?? "", + value: ac?.access_code_id, + description: `${ac?.type} ${ac?.access_code_id}`, })), }) From 23f38af2efeca3acd7d4eae9df5c8cc4542a9af7 Mon Sep 17 00:00:00 2001 From: kainpets Date: Wed, 15 May 2024 12:14:55 +0200 Subject: [PATCH 2/6] fix type for updated_custome_metdata --- lib/interact-for-custom-metadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/interact-for-custom-metadata.ts b/lib/interact-for-custom-metadata.ts index edbfd21..db3cc84 100644 --- a/lib/interact-for-custom-metadata.ts +++ b/lib/interact-for-custom-metadata.ts @@ -5,7 +5,7 @@ export const interactForCustomMetadata = async ( custom_metadata: CustomMetadata ) => { const seam = await getSeam() - const updated_custom_metadata = { ...custom_metadata } + const updated_custom_metadata: { [key: string]: string | boolean | null } = { ...custom_metadata } const displayCurrentCustomMetadata = () => { console.log("custom_metadata:") From 6b564b0d05458fc518653f7b3a3828f710311cc1 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 15 May 2024 10:15:21 +0000 Subject: [PATCH 3/6] ci - format code --- lib/interact-for-custom-metadata.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/interact-for-custom-metadata.ts b/lib/interact-for-custom-metadata.ts index db3cc84..77a826a 100644 --- a/lib/interact-for-custom-metadata.ts +++ b/lib/interact-for-custom-metadata.ts @@ -5,7 +5,9 @@ export const interactForCustomMetadata = async ( custom_metadata: CustomMetadata ) => { const seam = await getSeam() - const updated_custom_metadata: { [key: string]: string | boolean | null } = { ...custom_metadata } + const updated_custom_metadata: { [key: string]: string | boolean | null } = { + ...custom_metadata, + } const displayCurrentCustomMetadata = () => { console.log("custom_metadata:") From ead8d5094dac82d5e84461c761615342aaa127b3 Mon Sep 17 00:00:00 2001 From: kainpets Date: Wed, 15 May 2024 12:20:03 +0200 Subject: [PATCH 4/6] format --- lib/interact-for-custom-metadata.ts | 4 +++- package-lock.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/interact-for-custom-metadata.ts b/lib/interact-for-custom-metadata.ts index db3cc84..77a826a 100644 --- a/lib/interact-for-custom-metadata.ts +++ b/lib/interact-for-custom-metadata.ts @@ -5,7 +5,9 @@ export const interactForCustomMetadata = async ( custom_metadata: CustomMetadata ) => { const seam = await getSeam() - const updated_custom_metadata: { [key: string]: string | boolean | null } = { ...custom_metadata } + const updated_custom_metadata: { [key: string]: string | boolean | null } = { + ...custom_metadata, + } const displayCurrentCustomMetadata = () => { console.log("custom_metadata:") diff --git a/package-lock.json b/package-lock.json index 3a95221..8a2bc02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@types/prompts": "^2.4.9", "@vercel/ncc": "^0.38.1", "axios": "^1.6.2", - "bun-types": "*", + "bun-types": "latest", "chalk": "^5.3.0", "command-line-usage": "^7.0.1", "configstore": "^6.0.0", From 7b2b6a74ed2c5f58a5a0d88b0b0e2a277f9a3d4d Mon Sep 17 00:00:00 2001 From: kainpets Date: Wed, 15 May 2024 13:13:47 +0200 Subject: [PATCH 5/6] use CustomMetadata type --- lib/interact-for-custom-metadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/interact-for-custom-metadata.ts b/lib/interact-for-custom-metadata.ts index 77a826a..881078c 100644 --- a/lib/interact-for-custom-metadata.ts +++ b/lib/interact-for-custom-metadata.ts @@ -5,7 +5,7 @@ export const interactForCustomMetadata = async ( custom_metadata: CustomMetadata ) => { const seam = await getSeam() - const updated_custom_metadata: { [key: string]: string | boolean | null } = { + const updated_custom_metadata: CustomMetadata = { ...custom_metadata, } From 3ab680a84b132e53ba7de3594237d58bab60ac0f Mon Sep 17 00:00:00 2001 From: kainpets Date: Wed, 15 May 2024 13:24:18 +0200 Subject: [PATCH 6/6] add UpdatedCustomMetadata type --- lib/interact-for-custom-metadata.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/interact-for-custom-metadata.ts b/lib/interact-for-custom-metadata.ts index 881078c..ddee921 100644 --- a/lib/interact-for-custom-metadata.ts +++ b/lib/interact-for-custom-metadata.ts @@ -1,13 +1,16 @@ import prompts from "prompts" import { getSeam } from "./get-seam" import { CustomMetadata } from "@seamapi/types/connect" + +type UpdatedCustomMetadata = { + [x: string]: string | boolean | null +} + export const interactForCustomMetadata = async ( custom_metadata: CustomMetadata ) => { const seam = await getSeam() - const updated_custom_metadata: CustomMetadata = { - ...custom_metadata, - } + const updated_custom_metadata: UpdatedCustomMetadata = { ...custom_metadata } const displayCurrentCustomMetadata = () => { console.log("custom_metadata:")