Skip to content

Conversation

@chenderrick
Copy link
Contributor

@chenderrick chenderrick commented Sep 9, 2025

If you want to run this yourself, you need to change part of the actual etsy ts sdk because it is outdated.
You need to change line 2085 of node_modules/.pnpm/[email protected]/node_modules/etsy-ts/dist/api/data-contracts.d.ts
to
when_made: "made_to_order" | "2020_2025" | "2010_2019" | "2006_2009" | "before_2006" | "2000_2005" | "1990s" | "1980s" | "1970s" | "1960s" | "1950s" | "1940s" | "1930s" | "1920s" | "1910s" | "1900s" | "1800s" | "1700s" | "before_1700";

In action...
image
image
image
image

image (can easily make it add the image too - just need some extra prompt engineering ts

}

export const etsyScopes = "email_r shops_r listings_r";
export const etsyScopes = "address_r address_w billing_r cart_r cart_w email_r favorites_r favorites_w feedback_r listings_d listings_r listings_w profile_r profile_w recommend_r recommend_w shops_r shops_w transactions_r transactions_w";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add all scopes so no more 403s

<h2 className="text-lg font-bold">Listing</h2>
<div key={result.listing_id}>{result.title}</div>
)
</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fading frontend but this could look a lot nicer in theory.

import { z } from "zod";

import { EtsyTools } from "./tools/tools";

Copy link
Contributor Author

@chenderrick chenderrick Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to run this yourself, you need to change part of the actual etsy ts sdk because it is outdated.
You need to change line 2085 of node_modules/.pnpm/[email protected]/node_modules/etsy-ts/dist/api/data-contracts.d.ts
to
when_made: "made_to_order" | "2020_2025" | "2010_2019" | "2006_2009" | "before_2006" | "2000_2005" | "1990s" | "1980s" | "1970s" | "1960s" | "1950s" | "1940s" | "1930s" | "1920s" | "1910s" | "1900s" | "1800s" | "1700s" | "before_1700";

@jasonhedman how do I push this change up to prod

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it anyways with a pnpm patch ts


if (!shopId) throw new Error("Missing Etsy shop ID");

const listings = await etsy.ShopListing.getFeaturedListingsByShop({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change endpoint to getListings instead of getFeaturedListings
also add optional parameters

materials,
type,
styles,
...(shipping_profile_id !== undefined ? {shipping_profile_id} : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of optional params ts


- name: Install dependencies
run: pnpm install
run: pnpm install --no-frozen-lockfile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update CI to rely on updated lockfile after patching updated version of etsy-ts sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant