@crayonscodetech/cms-sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2689 -0
- package/dist/index.cjs +680 -0
- package/dist/index.d.cts +1112 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +1112 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +645 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/constants/pageTypes.ts","../src/constants/index.ts","../src/core/client.ts","../src/components/Icon.tsx"],"sourcesContent":["export const pageTypes = [\"home\", \"about\", \"contact\"] as const;\n\nexport const defaultPageTypes = [\n ...pageTypes,\n \"services\",\n \"blog\",\n \"team\",\n \"gallery\",\n \"events\",\n] as const;\n\nexport const allPageTypes = [\n ...pageTypes,\n \"custom\",\n \"services\",\n \"blog\",\n \"team\",\n \"gallery\",\n \"events\",\n] as const;\n","export * from \"./pageTypes\";\n\nexport const PAGINATION = {\n DEFAULT_PAGE: 1,\n DEFAULT_LIMIT: 10,\n BLOGS_PER_PAGE: 9,\n EVENTS_PER_PAGE: 9,\n ALBUMS_PER_PAGE: 9,\n MAX_ITEMS_FOR_SSG: 200,\n} as const;\n\nexport const SEARCH = {\n DEBOUNCE_MS: 500,\n MIN_QUERY_LENGTH: 2,\n} as const;\n\nexport const CACHE = {\n NO_CACHE: 0,\n SHORT: 60, // 1 minute\n MEDIUM: 300, // 5 minutes\n LONG: 3600, // 1 hour\n STATIC: 86400, // 24 hours\n} as const;\n\nexport const ANIMATION = {\n FAST: 0.2,\n NORMAL: 0.3,\n SLOW: 0.6,\n} as const;\n\nexport const CONTACT_SUBJECTS = [\n \"General Inquiry\",\n \"Project Proposal\",\n \"Careers\",\n \"Other\",\n] as const;\n\nexport const HTTP_STATUS = {\n OK: 200,\n CREATED: 201,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n INTERNAL_ERROR: 500,\n} as const;\n\nexport const MEDIA = {\n IMAGE_EXTENSIONS: [\".jpg\", \".jpeg\", \".png\", \".gif\", \".webp\", \".svg\"],\n VIDEO_EXTENSIONS: [\".mp4\", \".webm\", \".ogg\"],\n MAX_IMAGE_SIZE: 5 * 1024 * 1024,\n} as const;\n","import { CACHE, PAGINATION } from \"../constants\";\nimport type { PaginatedResponse, PaginationMeta } from \"../types/pagination\";\nimport type { Header } from \"../types/header\";\nimport type { Footer } from \"../types/footer\";\nimport type { SiteConfig } from \"../types/site-config\";\nimport type { Page, PageListItem } from \"../types/page\";\nimport type { AboutUsData } from \"../types/about\";\nimport type { Service } from \"../types/service\";\nimport type { Blog } from \"../types/blog\";\nimport type { Category } from \"../types/category\";\nimport type { TeamMember } from \"../types/team-member\";\nimport type { Album, AlbumItem } from \"../types/album\";\nimport type { BrandGroup, Brand } from \"../types/brand\";\nimport type { Testimonial } from \"../types/testimonials\";\nimport type { Event } from \"../types/event\";\nimport type { Faq } from \"../types/faq\";\nimport type { FaqGroup } from \"../types/faq-group\";\nimport type { Redirect, Redirect404Log, ResolvedRedirect } from \"../types/redirect\";\nimport type { ContactPayload, Contact } from \"../types/contact\";\nimport type { Product, ProductListItem, ProductVariant } from \"../types/product\";\nimport type { ProductCategory } from \"../types/product-category\";\nimport type { ProductBrand } from \"../types/product-brand\";\nimport type { Collection, CollectionDetail } from \"../types/collection\";\nimport type { Order, PlaceOrderPayload } from \"../types/order\";\nimport type { StoreSettings } from \"../types/store-setting\";\n\nexport interface FetchOptions extends RequestInit {\n revalidate?: number;\n tags?: string[];\n}\n\nexport interface CmsClientConfig {\n baseUrl: string;\n defaultOptions?: FetchOptions;\n}\n\nexport class CmsError extends Error {\n constructor(\n public message: string,\n public status?: number,\n public url?: string,\n ) {\n super(message);\n this.name = \"CmsError\";\n }\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nexport function createCmsClient(config: CmsClientConfig) {\n const { baseUrl, defaultOptions = {} } = config;\n\n async function cmsFetch<T>(\n endpoint: string,\n options: FetchOptions = {},\n retries = 2,\n ): Promise<T | null> {\n const url = `${baseUrl}${endpoint}`;\n const {\n revalidate = CACHE.NO_CACHE,\n tags,\n ...rest\n } = { ...defaultOptions, ...options };\n\n const fetchConfig: RequestInit & {\n next?: { revalidate?: number; tags?: string[] };\n } = {\n ...rest,\n next: {\n revalidate,\n ...(tags && { tags }),\n },\n };\n\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n const response = await fetch(url, fetchConfig);\n\n if (!response.ok) {\n const errorMsg = `API request failed: ${response.status} ${url}`;\n console.error(errorMsg);\n\n // Retry on transient server errors (502, 503, 504)\n if (attempt < retries && [502, 503, 504].includes(response.status)) {\n await sleep(Math.pow(2, attempt) * 1000);\n continue;\n }\n\n return null;\n }\n\n const result = await response.json();\n return result.data ?? result;\n } catch (error) {\n lastError = error instanceof Error ? error : new Error(String(error));\n console.error(\n `API request error (attempt ${attempt + 1}/${retries + 1}): ${url}`,\n lastError,\n );\n\n if (attempt < retries) {\n await sleep(Math.pow(2, attempt) * 1000);\n continue;\n }\n }\n }\n\n return null;\n }\n\n async function cmsFetchPaginated<T>(\n endpoint: string,\n options: FetchOptions = {},\n retries = 2,\n ): Promise<PaginatedResponse<T>> {\n const emptyResponse: PaginatedResponse<T> = {\n data: [],\n pagination: {\n page: 1,\n limit: PAGINATION.DEFAULT_LIMIT,\n total: 0,\n },\n };\n\n const url = `${baseUrl}${endpoint}`;\n const {\n revalidate = CACHE.NO_CACHE,\n tags,\n ...rest\n } = { ...defaultOptions, ...options };\n\n const fetchConfig: RequestInit & {\n next?: { revalidate?: number; tags?: string[] };\n } = {\n ...rest,\n next: {\n revalidate,\n ...(tags && { tags }),\n },\n };\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n const response = await fetch(url, fetchConfig);\n\n if (!response.ok) {\n console.error(`API request failed: ${response.status} ${url}`);\n\n if (attempt < retries && [502, 503, 504].includes(response.status)) {\n await sleep(Math.pow(2, attempt) * 1000);\n continue;\n }\n\n return emptyResponse;\n }\n\n return await response.json();\n } catch (error) {\n console.error(\n `API request error (attempt ${attempt + 1}/${retries + 1}): ${url}`,\n error,\n );\n\n if (attempt < retries) {\n await sleep(Math.pow(2, attempt) * 1000);\n continue;\n }\n }\n }\n\n return emptyResponse;\n }\n\n function buildQueryString(\n params: Record<string, string | number | string[] | number[] | undefined | null>,\n ): string {\n const query = new URLSearchParams();\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((v) => query.append(key, String(v)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n return query.toString();\n }\n\n // ============================================================================\n // Header, Footer, Site Config\n // ============================================================================\n\n function fetchHeader(\n siteId: string,\n options?: FetchOptions,\n ): Promise<Header | null> {\n return cmsFetch<Header>(`/api/public/cms/${siteId}/header/`, {\n revalidate: CACHE.MEDIUM,\n tags: [\"header\"],\n ...options,\n });\n }\n\n function fetchFooter(\n siteId: string,\n options?: FetchOptions,\n ): Promise<Footer | null> {\n return cmsFetch<Footer>(`/api/public/cms/${siteId}/footer/`, {\n revalidate: CACHE.MEDIUM,\n tags: [\"footer\"],\n ...options,\n });\n }\n\n function fetchSiteConfig(\n siteId: string,\n options?: FetchOptions,\n ): Promise<SiteConfig | null> {\n return cmsFetch<SiteConfig>(`/api/public/cms/${siteId}/site-config/`, {\n revalidate: CACHE.MEDIUM,\n tags: [\"site-config\"],\n ...options,\n });\n }\n\n // ============================================================================\n // Pages\n // ============================================================================\n\n function fetchPages(\n siteId: string,\n params: { page?: number } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<PageListItem>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<PageListItem>(\n `/api/public/cms/${siteId}/page/?${query}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"pages\"],\n ...options,\n },\n );\n }\n\n async function fetchPageByUrl(\n siteId: string,\n urlPath: string,\n options?: FetchOptions,\n ): Promise<Page | null> {\n try {\n const targetUrl =\n urlPath === \"/\" || urlPath === \"\"\n ? \"/\"\n : `/${urlPath.replace(/^\\/|\\/$/g, \"\")}`;\n\n return await cmsFetch<Page>(\n `/api/public/cms/${siteId}/page/by-url/?url=${encodeURIComponent(targetUrl)}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"pages\", `page-${targetUrl || \"root\"}`],\n ...options,\n },\n );\n } catch (error) {\n console.error(`Error in fetchPageByUrl for ${urlPath}:`, error);\n return null;\n }\n }\n\n // ============================================================================\n // About Us\n // ============================================================================\n\n function fetchAboutUs(\n siteId: string,\n options?: FetchOptions,\n ): Promise<AboutUsData | null> {\n return cmsFetch<AboutUsData>(`/api/public/cms/${siteId}/about-us/`, {\n revalidate: CACHE.MEDIUM,\n tags: [\"about\"],\n ...options,\n });\n }\n\n // ============================================================================\n // Services\n // ============================================================================\n\n async function fetchServices(\n siteId: string,\n options?: FetchOptions,\n ): Promise<Service[]> {\n const result = await cmsFetch<Service[]>(\n `/api/public/cms/${siteId}/services/`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"services\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n function fetchServiceById(\n siteId: string,\n id: string,\n options?: FetchOptions,\n ): Promise<Service | null> {\n return cmsFetch<Service>(`/api/public/cms/${siteId}/services/${id}/`, {\n revalidate: CACHE.SHORT,\n tags: [\"services\", `service-${id}`],\n ...options,\n });\n }\n\n // ============================================================================\n // Blogs\n // ============================================================================\n\n function fetchBlogs(\n siteId: string,\n params: { page?: number; limit?: number; search?: string } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<Blog>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<Blog>(`/api/public/cms/${siteId}/blog/?${query}`, {\n revalidate: CACHE.SHORT,\n tags: [\"blogs\"],\n ...options,\n });\n }\n\n function fetchBlogBySlug(\n siteId: string,\n slug: string,\n options?: FetchOptions,\n ): Promise<Blog | null> {\n return cmsFetch<Blog>(`/api/public/cms/${siteId}/blog/${slug}`, {\n revalidate: CACHE.SHORT,\n tags: [\"blogs\", `blog-${slug}`],\n ...options,\n });\n }\n\n // Backwards-compatible alias. Backend route resolves by slug.\n function fetchBlogById(\n siteId: string,\n idOrSlug: number | string,\n options?: FetchOptions,\n ): Promise<Blog | null> {\n return fetchBlogBySlug(siteId, String(idOrSlug), options);\n }\n\n // ============================================================================\n // Categories\n // ============================================================================\n\n async function fetchCategories(\n siteId: string,\n options?: FetchOptions,\n ): Promise<Category[]> {\n const result = await cmsFetch<Category[]>(\n `/api/public/cms/${siteId}/categories/`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"categories\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Team Members\n // ============================================================================\n\n async function fetchTeamMembers(\n siteId: string,\n options?: FetchOptions,\n ): Promise<TeamMember[]> {\n const result = await cmsFetch<TeamMember[]>(\n `/api/public/cms/${siteId}/team-members/`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"team\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n async function fetchTeamMembersByCategory(\n siteId: string,\n categoryId: string,\n options?: FetchOptions,\n ): Promise<TeamMember[]> {\n const result = await cmsFetch<TeamMember[]>(\n `/api/public/cms/${siteId}/team-members/?category_id=${categoryId}`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"team\", `team-category-${categoryId}`],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Albums\n // ============================================================================\n\n function fetchAlbums(\n siteId: string,\n params: { page?: number; limit?: number; search?: string } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<Album>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<Album>(\n `/api/public/cms/${siteId}/albums/?${query}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"albums\"],\n ...options,\n },\n );\n }\n\n async function fetchAlbumItems(\n siteId: string,\n params: { album?: string; album_id?: string },\n options?: FetchOptions,\n ): Promise<AlbumItem[]> {\n const query = buildQueryString(params);\n const result = await cmsFetch<AlbumItem[]>(\n `/api/public/cms/${siteId}/albums/album-items/?${query}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"album-items\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Brands\n // ============================================================================\n\n async function fetchBrandGroups(\n siteId: string,\n options?: FetchOptions,\n ): Promise<BrandGroup[]> {\n const result = await cmsFetch<BrandGroup[]>(\n `/api/public/cms/${siteId}/brand-groups/`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"brand-groups\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n async function fetchBrands(\n siteId: string,\n params: { group?: string; group_id?: string },\n options?: FetchOptions,\n ): Promise<Brand[]> {\n const query = buildQueryString(params);\n const result = await cmsFetch<Brand[]>(\n `/api/public/cms/${siteId}/brand-groups/brands/?${query}`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"brands\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Testimonials\n // ============================================================================\n\n async function fetchTestimonials(\n siteId: string,\n params?: { type?: \"testimonial\" | \"review\" | string },\n options?: FetchOptions,\n ): Promise<Testimonial[]> {\n const query = params?.type ? buildQueryString({ type: params.type }) : \"\";\n const result = await cmsFetch<Testimonial[]>(\n `/api/public/cms/${siteId}/testimonials/?${query}`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"testimonials\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Events\n // ============================================================================\n\n function fetchEvents(\n siteId: string,\n params: { page?: number; limit?: number; search?: string } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<Event>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<Event>(\n `/api/public/cms/${siteId}/events/?${query}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"events\"],\n ...options,\n },\n );\n }\n\n function fetchEventBySlug(\n siteId: string,\n slug: string,\n options?: FetchOptions,\n ): Promise<Event | null> {\n return cmsFetch<Event>(`/api/public/cms/${siteId}/events/${slug}`, {\n revalidate: CACHE.SHORT,\n tags: [\"events\", `event-${slug}`],\n ...options,\n });\n }\n\n // ============================================================================\n // FAQ Groups\n // ============================================================================\n\n async function fetchFaqGroups(\n siteId: string,\n options?: FetchOptions,\n ): Promise<FaqGroup[]> {\n const result = await cmsFetch<FaqGroup[]>(\n `/api/public/cms/${siteId}/faq-groups/`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"faq-groups\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n async function submitContactForm(\n siteId: string,\n payload: ContactPayload,\n options?: FetchOptions,\n ): Promise<Contact | null> {\n return cmsFetch<Contact>(`/api/public/cms/${siteId}/contact/`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n revalidate: CACHE.NO_CACHE, // Never cache form submissions\n ...options,\n });\n }\n\n async function fetchFaqs(\n siteId: string,\n params?: { group_id?: string },\n options?: FetchOptions,\n ): Promise<Faq[]> {\n const query = params?.group_id\n ? buildQueryString({ group_id: params.group_id })\n : \"\";\n const result = await cmsFetch<Faq[]>(\n `/api/public/cms/${siteId}/faqs/?${query}`,\n {\n revalidate: CACHE.MEDIUM,\n tags: [\"faqs\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n // ============================================================================\n // Redirects\n // ============================================================================\n\n async function fetchRedirects(\n siteId: string,\n options?: FetchOptions,\n ): Promise<Redirect[]> {\n const result = await cmsFetch<Redirect[]>(\n `/api/public/cms/${siteId}/redirects/`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"redirects\"],\n ...options,\n },\n );\n return result ?? [];\n }\n\n function resolveRedirect(\n siteId: string,\n sourcePath: string,\n options?: FetchOptions,\n ): Promise<ResolvedRedirect | null> {\n return cmsFetch<ResolvedRedirect>(\n `/api/public/cms/${siteId}/redirects/resolve/?sourcePath=${encodeURIComponent(sourcePath)}`,\n {\n revalidate: CACHE.NO_CACHE,\n tags: [\"redirects\", `redirect-${sourcePath}`],\n ...options,\n },\n );\n }\n\n function reportRedirect404(\n siteId: string,\n sourcePath: string,\n referrer?: string,\n options?: FetchOptions,\n ): Promise<Redirect404Log | null> {\n const headers = {\n \"Content-Type\": \"application/json\",\n ...(options?.headers ?? {}),\n };\n\n return cmsFetch<Redirect404Log>(\n `/api/public/cms/${siteId}/redirects/404-logs/`,\n {\n method: \"POST\",\n ...options,\n headers,\n body: JSON.stringify({\n source_path: sourcePath,\n referrer,\n }),\n revalidate: CACHE.NO_CACHE,\n tags: [\"redirects\", \"redirect-404-logs\"],\n },\n 0,\n );\n }\n\n // ============================================================================\n // Store — Products, Categories, Brands, Collections, Orders\n // Note: Uses /api/public/store/ prefix (NOT /api/public/cms/)\n // ============================================================================\n\n function fetchStoreSettings(\n siteId: string,\n options?: FetchOptions,\n ): Promise<StoreSettings | null> {\n return cmsFetch<StoreSettings>(`/api/public/store/${siteId}/settings/`, {\n revalidate: CACHE.MEDIUM,\n tags: [\"store-settings\"],\n ...options,\n });\n }\n\n function fetchProductCategories(\n siteId: string,\n params: {\n page?: number;\n limit?: number;\n search?: string;\n ordering?: string;\n parent_id?: string | null;\n } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<ProductCategory>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<ProductCategory>(\n `/api/public/store/${siteId}/categories/${query ? `?${query}` : \"\"}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"product-categories\"],\n ...options,\n },\n );\n }\n\n function fetchProductBrands(\n siteId: string,\n params: {\n page?: number;\n limit?: number;\n search?: string;\n ordering?: string;\n } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<ProductBrand>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<ProductBrand>(\n `/api/public/store/${siteId}/brands/${query ? `?${query}` : \"\"}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"product-brands\"],\n ...options,\n },\n );\n }\n\n function fetchProducts(\n siteId: string,\n params: {\n page?: number;\n limit?: number;\n search?: string;\n category_id?: string;\n tag_id?: string;\n brand_id?: string;\n is_featured?: \"true\" | \"false\";\n sort?: \"price_asc\" | \"price_desc\";\n min_price?: number;\n max_price?: number;\n availability?: \"in_stock\" | \"out_of_stock\";\n } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<ProductListItem>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<ProductListItem>(\n `/api/public/store/${siteId}/products/?${query}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"products\"],\n ...options,\n },\n );\n }\n\n function fetchProductDetail(\n siteId: string,\n slug: string,\n options?: FetchOptions,\n ): Promise<Product | null> {\n return cmsFetch<Product>(`/api/public/store/${siteId}/products/${slug}/`, {\n revalidate: CACHE.SHORT,\n tags: [\"products\", `product-${slug}`],\n ...options,\n });\n }\n\n function fetchProductsByTag(\n siteId: string,\n tag: string,\n params: { page?: number; limit?: number } = {},\n options?: FetchOptions,\n ): Promise<{ products: Array<{ item: unknown; product: Product }>; pagination: PaginationMeta } | null> {\n const query = buildQueryString({ tag, ...params });\n return cmsFetch<{ products: Array<{ item: unknown; product: Product }>; pagination: PaginationMeta } | null>(\n `/api/public/store/${siteId}/products/by-tag/${query ? `?${query}` : \"\"}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"products\", `products-tag-${tag}`],\n ...options,\n },\n );\n }\n\n function fetchCollections(\n siteId: string,\n params: {\n page?: number;\n limit?: number;\n search?: string;\n /** Comma-separated list of collection IDs (e.g., \"id1,id2\") */\n id?: string;\n } = {},\n options?: FetchOptions,\n ): Promise<PaginatedResponse<Collection>> {\n const query = buildQueryString(params);\n return cmsFetchPaginated<Collection>(\n `/api/public/store/${siteId}/collections/${query ? `?${query}` : \"\"}`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"collections\"],\n ...options,\n },\n );\n }\n\n function fetchCollectionDetail(\n siteId: string,\n slug: string,\n params: {\n page?: number;\n limit?: number;\n category_id?: string;\n } = {},\n options?: FetchOptions,\n ): Promise<CollectionDetail | null> {\n const query = buildQueryString(params);\n return cmsFetch<CollectionDetail>(\n `/api/public/store/${siteId}/collections/${slug}/${\n query ? `?${query}` : \"\"\n }`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"collections\", `collection-${slug}`],\n ...options,\n },\n );\n }\n\n function fetchCollectionDetailById(\n siteId: string,\n id: string,\n params: {\n page?: number;\n limit?: number;\n category_id?: string;\n } = {},\n options?: FetchOptions,\n ): Promise<CollectionDetail | null> {\n const query = buildQueryString(params);\n return cmsFetch<CollectionDetail>(\n `/api/public/store/${siteId}/collections/id/${id}/${\n query ? `?${query}` : \"\"\n }`,\n {\n revalidate: CACHE.SHORT,\n tags: [\"collections\", `collection-${id}`],\n ...options,\n },\n );\n }\n\n function placeOrder(\n siteId: string,\n payload: PlaceOrderPayload,\n options?: FetchOptions,\n ): Promise<Order | null> {\n return cmsFetch<Order>(`/api/public/store/${siteId}/orders/`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(payload),\n revalidate: CACHE.NO_CACHE,\n ...options,\n });\n }\n\n return {\n // Header, Footer, Site Config\n fetchHeader,\n fetchFooter,\n fetchSiteConfig,\n // Pages\n fetchPages,\n fetchPageByUrl,\n // About\n fetchAboutUs,\n // Services\n fetchServices,\n fetchServiceById,\n // Blogs\n fetchBlogs,\n fetchBlogBySlug,\n fetchBlogById,\n // Categories\n fetchCategories,\n // Team Members\n fetchTeamMembers,\n fetchTeamMembersByCategory,\n // Albums\n fetchAlbums,\n fetchAlbumItems,\n // Brands\n fetchBrandGroups,\n fetchBrands,\n // Testimonials\n fetchTestimonials,\n // Events\n fetchEvents,\n fetchEventBySlug,\n // FAQ Groups\n fetchFaqGroups,\n fetchFaqs,\n // Redirects\n fetchRedirects,\n resolveRedirect,\n reportRedirect404,\n // Contact\n submitContactForm,\n // Store\n fetchStoreSettings,\n fetchProductCategories,\n fetchProductBrands,\n fetchProducts,\n fetchProductDetail,\n fetchProductsByTag,\n fetchCollections,\n fetchCollectionDetail,\n fetchCollectionDetailById,\n placeOrder,\n // Generic fetch utilities\n fetch: cmsFetch,\n fetchPaginated: cmsFetchPaginated,\n utils: {\n buildQueryString,\n },\n };\n}\n","import React from \"react\";\nimport type { LucideProps } from \"lucide-react\";\nimport {\n Home,\n User,\n Settings,\n Mail,\n Bell,\n Calendar,\n Star,\n Heart,\n Bookmark,\n Search,\n Filter,\n Download,\n Upload,\n Trash,\n Edit,\n Plus,\n Minus,\n Check,\n X,\n ChevronRight,\n ChevronLeft,\n ChevronUp,\n ChevronDown,\n ChevronsUpDown,\n ArrowRight,\n ArrowLeft,\n ArrowUp,\n ArrowDown,\n File,\n Folder,\n Image,\n Video,\n Music,\n Lock,\n Unlock,\n Eye,\n EyeOff,\n Sun,\n Moon,\n Cloud,\n Zap,\n Activity,\n TrendingUp,\n TrendingDown,\n BarChart,\n PieChart,\n Database,\n Server,\n Wifi,\n Battery,\n Camera,\n Mic,\n Phone,\n MessageSquare,\n Send,\n Share,\n Link,\n ExternalLink,\n Globe,\n MapPin,\n Users,\n ShoppingCart,\n CreditCard,\n Package,\n Briefcase,\n Target,\n Flag,\n Clipboard,\n List,\n Grid,\n Layout,\n Layers,\n Copy,\n Save,\n RefreshCw,\n Maximize,\n Code,\n AlertCircle,\n Info,\n HelpCircle,\n CheckCircle,\n XCircle,\n Menu,\n MoreVertical,\n MoreHorizontal,\n PlayCircle,\n PauseCircle,\n LogIn,\n LogOut,\n UserPlus,\n UserMinus,\n Tag,\n Award,\n Gift,\n Truck,\n Clock,\n Handshake,\n Stethoscope,\n Microscope,\n GraduationCap,\n BookOpen,\n Building2,\n Trees,\n HeartHandshake,\n Brain,\n Lightbulb,\n} from \"lucide-react\";\n\n/**\n * A exhaustive map of Lucide icons commonly used in the CMS.\n */\nexport const ICON_MAP: Record<string, React.ComponentType<LucideProps>> = {\n Home,\n User,\n Settings,\n Mail,\n Bell,\n Calendar,\n Star,\n Heart,\n Bookmark,\n Search,\n Filter,\n Download,\n Upload,\n Trash,\n Edit,\n Plus,\n Minus,\n Check,\n X,\n ChevronRight,\n ChevronLeft,\n ChevronUp,\n ChevronDown,\n ChevronsUpDown,\n ArrowRight,\n ArrowLeft,\n ArrowUp,\n ArrowDown,\n File,\n Folder,\n Image,\n Video,\n Music,\n Lock,\n Unlock,\n Eye,\n EyeOff,\n Sun,\n Moon,\n Cloud,\n Zap,\n Activity,\n TrendingUp,\n TrendingDown,\n BarChart,\n PieChart,\n Database,\n Server,\n Wifi,\n Battery,\n Camera,\n Mic,\n Phone,\n MessageSquare,\n Send,\n Share,\n Link,\n ExternalLink,\n Globe,\n MapPin,\n Users,\n ShoppingCart,\n CreditCard,\n Package,\n Briefcase,\n Target,\n Flag,\n Clipboard,\n List,\n Grid,\n Layout,\n Layers,\n Copy,\n Save,\n RefreshCw,\n Maximize,\n Code,\n AlertCircle,\n Info,\n HelpCircle,\n CheckCircle,\n XCircle,\n Menu,\n MoreVertical,\n MoreHorizontal,\n PlayCircle,\n PauseCircle,\n LogIn,\n LogOut,\n UserPlus,\n UserMinus,\n Tag,\n Award,\n Gift,\n Truck,\n Clock,\n Handshake,\n Stethoscope,\n Microscope,\n GraduationCap,\n BookOpen,\n Building2,\n Trees,\n HeartHandshake,\n Brain,\n Lightbulb,\n};\n\nexport interface IconProps extends LucideProps {\n /** The name of the icon (from the ICON_MAP keys) */\n name: string;\n /** Fallback icon name if the provided name is not found */\n fallback?: string;\n}\n\n/**\n * Dynamic Icon component that renders Lucide icons by name.\n * Useful for CMS-driven icons where names are stored as strings.\n */\nexport function Icon({ name, fallback = \"HelpCircle\", ...props }: IconProps) {\n const IconComponent = ICON_MAP[name] ?? ICON_MAP[fallback] ?? HelpCircle;\n return React.createElement(IconComponent, props);\n}\n"],"mappings":";;;AAAA,MAAa,YAAY;CAAC;CAAQ;CAAS;CAAU;AAErD,MAAa,mBAAmB;CAC9B,GAAG;CACH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/C,MAAM,KAAK,UAAU,QAAQ;GAC7B,YAAY,MAAM;GAClB,GAAG;GACJ,CAAC;;CAGJ,OAAO;EAEL;EACA;EACA;EAEA;EACA;EAEA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,OAAO;EACP,gBAAgB;EAChB,OAAO,EACL,kBACD;EACF;;;;;;;AC5xBH,MAAa,WAA6D;CACxE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;AAaD,SAAgB,KAAK,EAAE,MAAM,WAAW,cAAc,GAAG,SAAoB;CAC3E,MAAM,gBAAgB,SAAS,SAAS,SAAS,aAAa;CAC9D,OAAO,MAAM,cAAc,eAAe,MAAM"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crayonscodetech/cms-sdk",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "CMS SDK for fetching data and shared types",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cms",
|
|
7
|
+
"sdk",
|
|
8
|
+
"nextjs",
|
|
9
|
+
"fetch"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/CrayonsCodeTech/cms-sdk#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/CrayonsCodeTech/cms-sdk/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/CrayonsCodeTech/cms-sdk.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Crayons",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.cts",
|
|
25
|
+
"import": "./dist/index.mjs",
|
|
26
|
+
"require": "./dist/index.cjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"main": "dist/index.cjs",
|
|
30
|
+
"types": "dist/index.d.cts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsdown",
|
|
36
|
+
"dev": "tsdown --watch",
|
|
37
|
+
"prepare": "pnpm build",
|
|
38
|
+
"lint": "eslint src/**/*.ts"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"lucide-react": "^1.14.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/react": "^19.2.14",
|
|
45
|
+
"tsdown": "latest",
|
|
46
|
+
"typescript": "^6.0.3"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"lucide-react": "^1.14.0",
|
|
50
|
+
"next": ">=13.0.0",
|
|
51
|
+
"react": ">=18.0.0",
|
|
52
|
+
"react-dom": ">=18.0.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"next": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"module": "dist/index.mjs"
|
|
60
|
+
}
|