Chenderrick/etsyapi improvements#244
Conversation
…p instead of getFeaturedListing
| } | ||
|
|
||
| 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"; |
There was a problem hiding this comment.
add all scopes so no more 403s
| <h2 className="text-lg font-bold">Listing</h2> | ||
| <div key={result.listing_id}>{result.title}</div> | ||
| ) | ||
| </div> |
There was a problem hiding this comment.
I'm fading frontend but this could look a lot nicer in theory.
| @@ -4,6 +4,8 @@ import { EtsyTools } from "./tools/tools"; | |||
|
|
|||
There was a problem hiding this comment.
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/etsy-ts@4.2.0/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
There was a problem hiding this comment.
I fixed it anyways with a pnpm patch ts
|
|
||
| if (!shopId) throw new Error("Missing Etsy shop ID"); | ||
|
|
||
| const listings = await etsy.ShopListing.getFeaturedListingsByShop({ |
There was a problem hiding this comment.
change endpoint to getListings instead of getFeaturedListings
also add optional parameters
| materials, | ||
| type, | ||
| styles, | ||
| ...(shipping_profile_id !== undefined ? {shipping_profile_id} : {}), |
There was a problem hiding this comment.
A bunch of optional params ts
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
| run: pnpm install --no-frozen-lockfile |
There was a problem hiding this comment.
update CI to rely on updated lockfile after patching updated version of etsy-ts sdk
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/etsy-ts@4.2.0/node_modules/etsy-ts/dist/api/data-contracts.d.tsto
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...



