Services refactor

This commit is contained in:
Dominic Ferrando
2026-06-23 15:36:53 -04:00
parent 5bae0f067d
commit 720aa61c66
6 changed files with 502 additions and 638 deletions
@@ -1,11 +1,27 @@
import { PrintfulService, WebflowService } from "@blade-and-brawn/commerce";
import { PrintfulClient, WebflowClient } from "@blade-and-brawn/commerce";
import {
PRINTFUL_AUTH,
PRINTFUL_STORE_ID,
WEBFLOW_SITE_ID,
WEBFLOW_COLLECTION_ID,
WEBFLOW_AUTH,
WEBFLOW_WEBHOOK_SECRET,
} from "$env/static/private";
import type { PageServerLoad } from "./$types";
const printful = new PrintfulClient({ token: PRINTFUL_AUTH, storeId: PRINTFUL_STORE_ID });
const webflow = new WebflowClient({
siteId: WEBFLOW_SITE_ID,
collectionsId: WEBFLOW_COLLECTION_ID,
token: WEBFLOW_AUTH,
webhookSecret: WEBFLOW_WEBHOOK_SECRET,
});
export const load = async ({}: Parameters<PageServerLoad>[0]) => {
return {
products: {
printful: PrintfulService.Products.getAll(),
webflow: WebflowService.Products.getAll(),
printful: printful.Products.getAll(),
webflow: webflow.Products.getAll(),
},
};
};