-
Notifications
You must be signed in to change notification settings - Fork 79
Chenderrick/etsyapi improvements #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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> |
There was a problem hiding this comment.
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"; | ||
|
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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} : {}), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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.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...



