Add documenation of all apps/packages
This commit is contained in:
@@ -1,12 +1,30 @@
|
||||
# Printful
|
||||
# @blade-and-brawn/commerce
|
||||
|
||||
## Definitions
|
||||
Printful and Webflow API clients, plus the `ProductSyncer` that keeps Webflow
|
||||
CMS products/SKUs in sync with Printful's catalog.
|
||||
|
||||
- "Color-grouped" products
|
||||
- Products in this format: "Product Name [color]"
|
||||
|
||||
## Constraints
|
||||
## Exports
|
||||
|
||||
1. Color-grouped products should no more than *one* printful color variant
|
||||
2. The single color-grouped product variant should match [color]
|
||||
3. Printful product names should be unique
|
||||
- `PrintfulClient` — `new PrintfulClient({ storeId, token, webhookSecret })`;
|
||||
products, webhooks.
|
||||
- `WebflowClient` — `new WebflowClient({ siteId, collectionIds: { products, skus }, token, webhookSecret })`;
|
||||
CMS products/SKUs, webhooks.
|
||||
- `ProductSyncer` — `new ProductSyncer(printful, webflow)`; `syncApparel(options)`
|
||||
pulls Printful products and upserts them into the Webflow collections,
|
||||
respecting the naming conventions below.
|
||||
- Shared `Printful`/`Webflow` request/response types (`util/types.ts`) and misc
|
||||
helpers (`util/misc.ts`, e.g. `formatSlug`).
|
||||
|
||||
## Printful product naming conventions
|
||||
|
||||
- "Color-grouped" products follow the format `Product Name [color]`.
|
||||
|
||||
Constraints:
|
||||
|
||||
1. A color-grouped product should have no more than *one* Printful color variant.
|
||||
2. That single color-grouped product's variant should match `[color]`.
|
||||
3. Printful product names should be unique.
|
||||
|
||||
See `apps/api/src/scripts/register-webhooks.ts` for how webhooks are
|
||||
registered against the API's domain, and `apps/api/src/services/commerce.ts`
|
||||
for how `ProductSyncer` is invoked.
|
||||
|
||||
Reference in New Issue
Block a user