chore: minor refactor
This commit is contained in:
		
							parent
							
								
									82ae26930b
								
							
						
					
					
						commit
						97add456a7
					
				| 
						 | 
					@ -13,7 +13,7 @@ interface PlatformIdentity {
 | 
				
			||||||
export interface UserConfig {
 | 
					export interface UserConfig {
 | 
				
			||||||
  name: string;
 | 
					  name: string;
 | 
				
			||||||
  identities: PlatformIdentity[];
 | 
					  identities: PlatformIdentity[];
 | 
				
			||||||
  relatives?: {
 | 
					  friends?: {
 | 
				
			||||||
    related_as: string[];
 | 
					    related_as: string[];
 | 
				
			||||||
    user: UserConfig;
 | 
					    user: UserConfig;
 | 
				
			||||||
  }[];
 | 
					  }[];
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@ const UserConfigSchema: z.ZodType<UserConfig> = z.lazy(() =>
 | 
				
			||||||
  z.object({
 | 
					  z.object({
 | 
				
			||||||
    name: z.string(),
 | 
					    name: z.string(),
 | 
				
			||||||
    identities: z.array(PlatformIdentitySchema),
 | 
					    identities: z.array(PlatformIdentitySchema),
 | 
				
			||||||
    relatives: z
 | 
					    friends: z
 | 
				
			||||||
      .array(
 | 
					      .array(
 | 
				
			||||||
        z.object({
 | 
					        z.object({
 | 
				
			||||||
          related_as: z.array(z.string()),
 | 
					          related_as: z.array(z.string()),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,7 @@ export async function send_email({ to, subject, html }: ResendParams) {
 | 
				
			||||||
      from: "anya@tri.raj.how",
 | 
					      from: "anya@tri.raj.how",
 | 
				
			||||||
      to,
 | 
					      to,
 | 
				
			||||||
      subject,
 | 
					      subject,
 | 
				
			||||||
 | 
					      replyTo: "anya@raj.how",
 | 
				
			||||||
      html:
 | 
					      html:
 | 
				
			||||||
        (await formatToHtml({
 | 
					        (await formatToHtml({
 | 
				
			||||||
          to,
 | 
					          to,
 | 
				
			||||||
| 
						 | 
					@ -211,7 +212,7 @@ async function formatToHtml({
 | 
				
			||||||
    1. Vercel Invite Template:
 | 
					    1. Vercel Invite Template:
 | 
				
			||||||
    ${vercel_invite_template}
 | 
					    ${vercel_invite_template}
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    2. Stripe Welcome Template:
 | 
					    2. Stripe Welcome Template (use this for most simple messages):
 | 
				
			||||||
    ${stripe_welcome_template}
 | 
					    ${stripe_welcome_template}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    3. Linear Login Code Template:
 | 
					    3. Linear Login Code Template:
 | 
				
			||||||
| 
						 | 
					@ -219,6 +220,7 @@ async function formatToHtml({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Pick a template and put the data in it to create the final HTML string.
 | 
					    Pick a template and put the data in it to create the final HTML string.
 | 
				
			||||||
    Do not Make up false data, use only the given data.
 | 
					    Do not Make up false data, use only the given data.
 | 
				
			||||||
 | 
					    Make sure to replace all the example data in the template with data relavent to the context.
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    RETURN ONLY HTML STRING
 | 
					    RETURN ONLY HTML STRING
 | 
				
			||||||
    `,
 | 
					    `,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,7 @@ export async function search_user(
 | 
				
			||||||
  context_message: Message
 | 
					  context_message: Message
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
 | 
					    console.log(JSON.stringify(userConfigs));
 | 
				
			||||||
    const res = await ask({
 | 
					    const res = await ask({
 | 
				
			||||||
      prompt: `You are a Search Tool that takes in a name and platform and returns the user's details. You are searching for ${name} on ${platform}.
 | 
					      prompt: `You are a Search Tool that takes in a name and platform and returns the user's details. You are searching for ${name} on ${platform}.
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue