@gt6/sdk 1.0.5 → 1.0.6

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.
@@ -399,12 +399,26 @@ class ProductsAPI {
399
399
  async getProductsByCategory(categoryId, options) {
400
400
  // 获取分类数据
401
401
  const categories = await this.getCategories();
402
+ // 递归查找分类的函数
403
+ const findCategoryById = (cats, targetId) => {
404
+ for (const cat of cats) {
405
+ if (cat.categoryId === targetId) {
406
+ return cat;
407
+ }
408
+ if (cat.children && cat.children.length > 0) {
409
+ const found = findCategoryById(cat.children, targetId);
410
+ if (found)
411
+ return found;
412
+ }
413
+ }
414
+ return null;
415
+ };
402
416
  // 将单个分类ID转换为数组
403
417
  const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
404
418
  // 收集所有指定分类下的产品ID
405
419
  const allProductIds = [];
406
420
  categoryIds.forEach(id => {
407
- const targetCategory = categories.find(cat => cat.categoryId === id);
421
+ const targetCategory = findCategoryById(categories, id);
408
422
  if (targetCategory) {
409
423
  allProductIds.push(...targetCategory.productIds);
410
424
  }
@@ -491,8 +505,22 @@ class ProductsAPI {
491
505
  async getCategoryPath(categoryId) {
492
506
  // 获取所有分类数据
493
507
  const categories = await this.getCategories();
494
- // 查找目标分类
495
- const targetCategory = categories.find(cat => cat.categoryId === categoryId);
508
+ // 递归查找目标分类的函数
509
+ const findCategoryById = (cats, targetId) => {
510
+ for (const cat of cats) {
511
+ if (cat.categoryId === targetId) {
512
+ return cat;
513
+ }
514
+ if (cat.children && cat.children.length > 0) {
515
+ const found = findCategoryById(cat.children, targetId);
516
+ if (found)
517
+ return found;
518
+ }
519
+ }
520
+ return null;
521
+ };
522
+ // 查找目标分类(包括子分类)
523
+ const targetCategory = findCategoryById(categories, categoryId);
496
524
  if (!targetCategory) {
497
525
  return {
498
526
  path: [],
@@ -503,7 +531,7 @@ class ProductsAPI {
503
531
  // 构建分类路径
504
532
  const path = [];
505
533
  const breadcrumbs = [];
506
- // 递归查找父分类
534
+ // 递归查找父分类的函数
507
535
  const buildPath = (currentCategory, level = 0) => {
508
536
  // 将当前分类添加到路径开头(因为我们要从根到叶子构建)
509
537
  path.unshift(currentCategory);
@@ -514,7 +542,7 @@ class ProductsAPI {
514
542
  });
515
543
  // 如果有父分类,继续递归
516
544
  if (currentCategory.parentId && currentCategory.parentId !== 0) {
517
- const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);
545
+ const parentCategory = findCategoryById(categories, currentCategory.parentId);
518
546
  if (parentCategory) {
519
547
  buildPath(parentCategory, level + 1);
520
548
  }
@@ -535,8 +563,22 @@ class ProductsAPI {
535
563
  async getSubCategories(categoryId, options) {
536
564
  // 获取所有分类数据
537
565
  const categories = await this.getCategories();
538
- // 查找目标分类
539
- const targetCategory = categories.find(cat => cat.categoryId === categoryId);
566
+ // 递归查找分类的函数
567
+ const findCategoryById = (cats, targetId) => {
568
+ for (const cat of cats) {
569
+ if (cat.categoryId === targetId) {
570
+ return cat;
571
+ }
572
+ if (cat.children && cat.children.length > 0) {
573
+ const found = findCategoryById(cat.children, targetId);
574
+ if (found)
575
+ return found;
576
+ }
577
+ }
578
+ return null;
579
+ };
580
+ // 查找目标分类(包括子分类)
581
+ const targetCategory = findCategoryById(categories, categoryId);
540
582
  if (!targetCategory) {
541
583
  return {
542
584
  subCategories: [],
@@ -553,8 +595,20 @@ class ProductsAPI {
553
595
  if (currentDepth >= maxDepth) {
554
596
  return;
555
597
  }
556
- // 查找直接子分类
557
- const children = categories.filter(cat => cat.parentId === parentId);
598
+ // 递归查找直接子分类
599
+ const findChildren = (cats, parentId) => {
600
+ const children = [];
601
+ for (const cat of cats) {
602
+ if (cat.parentId === parentId) {
603
+ children.push(cat);
604
+ }
605
+ if (cat.children && cat.children.length > 0) {
606
+ children.push(...findChildren(cat.children, parentId));
607
+ }
608
+ }
609
+ return children;
610
+ };
611
+ const children = findChildren(categories, parentId);
558
612
  children.forEach(child => {
559
613
  subCategories.push(child);
560
614
  // 如果需要递归且未达到最大深度,继续查找子分类
@@ -1 +1 @@
1
- {"version":3,"file":"gt6-sdk.cjs.js","sources":["../src/core/types.ts","../src/core/client.ts","../src/modules/articles.ts","../src/modules/products.ts","../src/index.ts"],"sourcesContent":["// 基础配置类型\nexport interface GT6Config {\n baseUrl: string;\n apiKey?: string;\n platformId: string | number;\n rootCategoryId?: string | number;\n tagAlias?: string;\n // 产品专用配置字段\n productRootCategoryId?: string | number;\n productTagAlias?: string;\n version?: string;\n timeout?: number;\n cache?: {\n enabled: boolean;\n ttl: number; // 缓存时间(毫秒)\n };\n}\n\n// 分类相关类型\nexport interface Category {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n articleIds: number[];\n children: Category[];\n}\n\nexport interface CategoryResponse {\n platformId: number;\n categories: Category[];\n generatedAt: string;\n}\n\n// 产品分类相关类型\nexport interface ProductCategory {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n productIds: number[];\n children: ProductCategory[];\n}\n\nexport interface ProductCategoryResponse {\n platformId: number;\n categories: ProductCategory[];\n generatedAt: string;\n}\n\n// 标签相关类型\nexport interface Tag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n articleIds: number[];\n}\n\nexport interface TagResponse {\n platformId: number;\n tags: Tag[];\n generatedAt: string;\n}\n\n// 产品标签相关类型\nexport interface ProductTag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n productIds: number[];\n}\n\nexport interface ProductTagResponse {\n platformId: number;\n tags: ProductTag[];\n generatedAt: string;\n}\n\n// 文章元数据类型\nexport interface ArticleMetaData {\n metaId: number;\n articleId: number;\n metaKey: string;\n metaValue: string;\n type: number;\n templateId: number;\n groupId: number;\n sortOrder: number;\n aiId: number;\n fieldId: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章图片类型\nexport interface ArticleImage {\n imageId: number;\n articleId: number;\n metaId: number | null;\n imageUrl: string;\n imageType: 'cover' | 'content';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章类型\nexport interface Article {\n articleId: number;\n title: string;\n content: string;\n status: 'published' | 'draft' | 'archived';\n publishedAt: string;\n templateId: number;\n aiId: number;\n platformId: number;\n isVisible: boolean;\n displayTemplate: string;\n createdAt: any;\n updatedAt: any;\n categories: Category[];\n tags: Tag[];\n metaData: ArticleMetaData[];\n images: ArticleImage[];\n generatedAt: string;\n}\n\n// 产品详情类型\nexport interface ProductDetail {\n detailId: number;\n productId: number;\n detailKey: string;\n detailValue: string;\n extraInfo: string;\n}\n\n// 产品选项值类型\nexport interface ProductOptionValue {\n valueId: number;\n optionId: number;\n value: string;\n description: string;\n priceAdjustment: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品选项类型\nexport interface ProductOption {\n optionId: number;\n productId: number;\n optionName: string;\n createdAt: any;\n updatedAt: any;\n values: ProductOptionValue[];\n}\n\n// 产品变体类型\nexport interface ProductVariant {\n variantId: number;\n productId: number;\n sku: string;\n price: string;\n stock: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品图片类型\nexport interface ProductImage {\n imageId: number;\n productId: number;\n productDetailId: number | null;\n optionValueId: number | null;\n imageUrl: string;\n imageType: 'gallery' | 'thumbnail' | 'detail';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 地区类型\nexport interface Region {\n regionId: number;\n platformId: number;\n regionCode: string;\n regionName: string;\n regionLevel: string;\n parentId: number;\n children?: Region[];\n}\n\n// 运费规则类型\nexport interface ShippingRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n firstUnit: string;\n firstFee: string;\n additionalUnit: string;\n additionalFee: string;\n conditionType: string;\n conditionValue: string | null;\n createTime: any;\n updateTime: any;\n}\n\n// 运费模板类型\nexport interface ShippingTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultFee: string;\n freeShippingLimit: string;\n createTime: any;\n updateTime: any;\n rules: ShippingRule[];\n}\n\n// 运费响应类型\nexport interface ShippingResponse {\n platformId: number;\n templates: ShippingTemplate[];\n generatedAt: string;\n}\n\n// 税费规则类型\nexport interface TaxRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n taxRate: string;\n createTime: any;\n updateTime: any;\n}\n\n// 税费模板类型\nexport interface TaxTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultTaxRate: string;\n createTime: any;\n updateTime: any;\n rules: TaxRule[];\n}\n\n// 税费响应类型\nexport interface TaxResponse {\n platformId: number;\n templates: TaxTemplate[];\n generatedAt: string;\n}\n\n// 订阅类型\nexport interface Subscription {\n subscriptionId: number;\n productId: number;\n billingCycle: number;\n billingCycleUnit: string;\n billingCycleCount: number;\n setupFee: string;\n trialDays: number;\n trialPrice: string;\n renewalDiscount: string;\n autoRenew: boolean;\n allowCancel: boolean;\n cancelPolicy: string;\n refundPolicy: string;\n maxCycles: number;\n gracePeriod: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 批发类型\nexport interface Wholesale {\n wholesaleId: number;\n productId: number;\n minOrderQuantity: number;\n maxOrderQuantity: number;\n allowMixedVariants: boolean;\n showRetailPrice: boolean;\n wholesaleDescription: string;\n paymentTerms: string;\n shippingTerms: string;\n}\n\n// 价格层级类型\nexport interface PriceTier {\n tierId: number;\n wholesaleId: number;\n userLevel: number | null;\n minQuantity: number;\n maxQuantity: number;\n priceType: number;\n priceValue: string;\n sortOrder: number;\n}\n\n// 变体价格类型\nexport interface VariantPrice {\n id: number;\n wholesaleId: number;\n tierId: number;\n variantId: number;\n priceType: number;\n priceValue: string;\n}\n\n// 众筹类型\nexport interface Crowdfunding {\n crowdfundingId: number;\n productId: number;\n targetAmount: string;\n currentAmount: string;\n supporterCount: number;\n startTime: any;\n endTime: any;\n status: number;\n minSupportAmount: string;\n allowOverFunding: boolean;\n overFundingLimit: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹奖励类型\nexport interface Reward {\n rewardId: number;\n crowdfundingId: number;\n variantId: number;\n rewardName: string;\n rewardDescription: string;\n rewardAmount: string;\n rewardLimit: number;\n rewardClaimed: number;\n shippingRequired: boolean;\n estimatedDeliveryTime: any;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹更新类型\nexport interface CrowdfundingUpdate {\n updateId: number;\n crowdfundingId: number;\n updateTitle: string;\n updateContent: string;\n isPublic: boolean;\n updateTime: any;\n}\n\n// 众筹FAQ类型\nexport interface CrowdfundingFAQ {\n faqId: number;\n crowdfundingId: number;\n question: string;\n answer: string;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 简单理财类型\nexport interface SimpleFinance {\n simpleFinanceId: number;\n productId: number;\n calculationPeriod: number;\n calculationPeriodUnit: string;\n interestRate: string;\n minInvestment: string;\n maxInvestment: string;\n minInvestmentUnit: string;\n maxInvestmentUnit: string;\n investmentPeriod: number;\n investmentPeriodUnit: string;\n}\n\n// 产品类型\nexport interface Product {\n productId: number;\n productName: string;\n description: string;\n metaKeywords: string;\n price: string;\n priceChangePercent: string;\n status: number;\n productType: number;\n native: number;\n shared: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n oldProductId: number | null;\n details: ProductDetail[];\n options: ProductOption[];\n variants: ProductVariant[];\n images: ProductImage[];\n categories: ProductCategory[];\n tags: ProductTag[];\n regions: Region[];\n shippingTemplates: ShippingTemplate[];\n taxTemplates: TaxTemplate[];\n subscription?: Subscription; // 当productType为2时存在\n wholesale?: Wholesale; // 当productType为3时存在\n priceTiers?: PriceTier[]; // 当productType为3时存在\n variantPrices?: VariantPrice[]; // 当productType为3时存在\n crowdfunding?: Crowdfunding; // 当productType为4时存在\n rewards?: Reward[]; // 当productType为4时存在\n updates?: CrowdfundingUpdate[]; // 当productType为4时存在\n faqs?: CrowdfundingFAQ[]; // 当productType为4时存在\n simpleFinance?: SimpleFinance; // 当productType为5时存在\n generatedAt: string;\n}\n\n// 文章列表项类型(简化版)\nexport interface ArticleListItem {\n articleId: number;\n title: string;\n status: string;\n publishedAt: string;\n categories: Category[];\n tags: Tag[];\n coverImage?: string;\n}\n\n// 产品列表项类型(简化版)\nexport interface ProductListItem {\n productId: number;\n productName: string;\n price: string;\n status: number;\n categories: ProductCategory[];\n tags: ProductTag[];\n coverImage?: string;\n}\n\n// 错误类型\nexport class GT6Error extends Error {\n constructor(\n message: string,\n public statusCode?: number\n ) {\n super(message);\n this.name = 'GT6Error';\n }\n}\n\n// 查询参数类型\nexport interface ArticleQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: string;\n limit?: number;\n offset?: number;\n sortBy?: 'publishedAt' | 'title' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 产品查询参数类型\nexport interface ProductQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: number;\n limit?: number;\n offset?: number;\n sortBy?: 'price' | 'productName' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 根据标签获取文章的选项类型\nexport interface ArticlesByTagOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n tagAlias?: string;\n}\n\n// 根据分类获取文章的选项类型\nexport interface ArticlesByCategoryOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n}\n\n// 根据标签获取产品的选项类型\nexport interface ProductsByTagOptions {\n page?: number;\n limit?: number;\n status?: number;\n productTagAlias?: string;\n}\n\n// 根据分类获取产品的选项类型\nexport interface ProductsByCategoryOptions {\n page?: number;\n limit?: number;\n status?: number;\n}\n\n// 文章统计类型\nexport interface ArticleStats {\n total: number;\n published: number;\n draft: number;\n archived: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\n// 产品统计类型\nexport interface ProductStats {\n total: number;\n active: number;\n inactive: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\nexport interface GT6Response<T> {\n success: boolean;\n data: T;\n error?: string;\n}\n\nexport interface ArticleResponse {\n article: Article;\n}\n\nexport interface ProductResponse {\n product: Product;\n}\n\nexport interface CategoryResponse {\n categories: Category[];\n}\n\nexport interface ProductCategoryResponse {\n categories: ProductCategory[];\n}\n\nexport interface TagResponse {\n tags: Tag[];\n}\n\nexport interface ProductTagResponse {\n tags: ProductTag[];\n}\n\n// 区域响应类型\nexport interface RegionResponse {\n platformId: number;\n regions: Region[];\n generatedAt: string;\n} ","import { GT6Config, GT6Error } from './types';\r\n\r\nexport class GT6Client {\r\n private config: GT6Config;\r\n private cache: Map<string, { data: any; timestamp: number }>;\r\n\r\n constructor(config: GT6Config) {\r\n this.config = {\r\n timeout: 10000,\r\n cache: {\r\n enabled: true,\r\n ttl: 300000 // 5分钟默认缓存\r\n },\r\n ...config\r\n };\r\n this.cache = new Map();\r\n }\r\n\r\n /**\r\n * 发起HTTP请求\r\n */\r\n async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {\r\n const url = `${this.config.baseUrl}${endpoint}`;\r\n const cacheKey = `${options.method || 'GET'}:${url}`;\r\n\r\n // 检查缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n const cached = this.cache.get(cacheKey);\r\n if (cached && Date.now() - cached.timestamp < this.config.cache.ttl) {\r\n return cached.data;\r\n }\r\n }\r\n\r\n try {\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\r\n\r\n const response = await fetch(url, {\r\n ...options,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...options.headers,\r\n },\r\n signal: controller.signal\r\n });\r\n\r\n clearTimeout(timeoutId);\r\n\r\n if (!response.ok) {\r\n throw new GT6Error(\r\n `HTTP ${response.status}: ${response.statusText}`,\r\n response.status\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n\r\n // 更新缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n this.cache.set(cacheKey, { data, timestamp: Date.now() });\r\n }\r\n\r\n return data;\r\n } catch (error: any) {\r\n if (error instanceof GT6Error) {\r\n throw error;\r\n }\r\n \r\n if (error.name === 'AbortError') {\r\n throw new GT6Error('Request timeout', 408);\r\n }\r\n \r\n throw new GT6Error(`Network error: ${error.message}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取配置\r\n */\r\n getConfig(): GT6Config {\r\n return { ...this.config };\r\n }\r\n\r\n /**\r\n * 清除缓存\r\n */\r\n clearCache(): void {\r\n this.cache.clear();\r\n }\r\n\r\n /**\r\n * 获取缓存统计\r\n */\r\n getCacheStats(): { size: number; entries: Array<{ key: string; age: number }> } {\r\n const entries = Array.from(this.cache.entries()).map(([key, value]) => ({\r\n key,\r\n age: Date.now() - value.timestamp\r\n }));\r\n\r\n return {\r\n size: this.cache.size,\r\n entries\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Article,\r\n Category,\r\n Tag,\r\n CategoryResponse,\r\n TagResponse,\r\n ArticlesByTagOptions,\r\n ArticlesByCategoryOptions\r\n} from '../core/types';\r\n\r\nexport class ArticlesAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string): Promise<Article> {\r\n return this.client.request<Article>(`/articles/${articleId}.json`);\r\n }\r\n\r\n /**\r\n * 2. 获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string): Promise<Category[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = rootCategoryId || config.rootCategoryId || '671920';\r\n \r\n const response = await this.client.request<CategoryResponse>(\r\n `/article-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string): Promise<Tag[]> {\r\n const config = this.client.getConfig();\r\n const alias = tagAlias || config.tagAlias || '001';\r\n \r\n const response = await this.client.request<TagResponse>(\r\n `/article-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取文章列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allArticleIds.push(...targetCategory.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取文章列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递tagAlias参数\r\n const tags = await this.getTags(options?.tagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allArticleIds.push(...targetTag.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: Category[];\r\n currentCategory: Category | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: Category[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: Category, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: Category[];\r\n currentCategory: Category | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: Category[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Product,\r\n ProductCategory,\r\n ProductTag,\r\n ProductCategoryResponse,\r\n ProductTagResponse,\r\n ProductsByTagOptions,\r\n ProductsByCategoryOptions,\r\n TaxResponse,\r\n ShippingResponse,\r\n RegionResponse\r\n} from '../core/types';\r\n\r\nexport class ProductsAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string): Promise<Product> {\r\n const product = await this.client.request<Product>(`/products/${productId}.json`);\r\n \r\n // 检查产品是否有销售区域和税费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.taxTemplates && product.taxTemplates.length > 0) {\r\n try {\r\n // 获取税费信息\r\n const taxInfo = await this.getTaxInfo();\r\n \r\n // 为每个税费模板添加规则\r\n product.taxTemplates = product.taxTemplates.map(template => {\r\n const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取税费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch tax info:', error);\r\n }\r\n }\r\n \r\n // 检查产品是否有销售区域和运费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.shippingTemplates && product.shippingTemplates.length > 0) {\r\n try {\r\n // 获取运费信息\r\n const shippingInfo = await this.getShippingInfo();\r\n \r\n // 为每个运费模板添加规则\r\n product.shippingTemplates = product.shippingTemplates.map(template => {\r\n const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取运费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch shipping info:', error);\r\n }\r\n }\r\n \r\n return product;\r\n }\r\n\r\n /**\r\n * 2. 获取产品分类列表\r\n */\r\n async getCategories(productRootCategoryId?: number | string): Promise<ProductCategory[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = productRootCategoryId || config.productRootCategoryId || '277233';\r\n \r\n const response = await this.client.request<ProductCategoryResponse>(\r\n `/product-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取产品标签列表\r\n */\r\n async getTags(productTagAlias?: string): Promise<ProductTag[]> {\r\n const config = this.client.getConfig();\r\n const alias = productTagAlias || config.productTagAlias || '01';\r\n \r\n const response = await this.client.request<ProductTagResponse>(\r\n `/product-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取产品列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allProductIds.push(...targetCategory.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取产品列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递productTagAlias参数\r\n const tags = await this.getTags(options?.productTagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allProductIds.push(...targetTag.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: ProductCategory[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: ProductCategory, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: ProductCategory[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n\r\n /**\r\n * 8. 获取税费信息\r\n * 获取平台的所有税费模板和规则\r\n */\r\n async getTaxInfo(): Promise<TaxResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<TaxResponse>(`/tax/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 9. 获取运费信息\r\n * 获取平台的所有运费模板和规则\r\n */\r\n async getShippingInfo(): Promise<ShippingResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<ShippingResponse>(`/shipping/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 10. 获取区域信息\r\n * 获取平台的所有区域信息,包括层级结构\r\n */\r\n async getRegions(): Promise<RegionResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<RegionResponse>(`/regions/platform-${config.platformId}.json`);\r\n }\r\n} ","import { GT6Client } from './core/client';\r\nimport { ArticlesAPI } from './modules/articles';\r\nimport { ProductsAPI } from './modules/products';\r\nimport { \r\n GT6Config, \r\n ArticlesByCategoryOptions, \r\n ArticlesByTagOptions,\r\n ProductsByCategoryOptions,\r\n ProductsByTagOptions\r\n} from './core/types';\r\n\r\n/**\r\n * GT6 SDK 主类\r\n * 提供文章和产品管理相关的所有功能\r\n */\r\nexport class GT6SDK {\r\n public articles: ArticlesAPI;\r\n public products: ProductsAPI;\r\n\r\n constructor(config: GT6Config) {\r\n const client = new GT6Client(config);\r\n this.articles = new ArticlesAPI(client);\r\n this.products = new ProductsAPI(client);\r\n }\r\n\r\n /**\r\n * 获取客户端实例(用于高级用法)\r\n */\r\n getClient(): GT6Client {\r\n return (this.articles as any).client;\r\n }\r\n\r\n /**\r\n * 清除所有缓存\r\n */\r\n clearCache(): void {\r\n this.getClient().clearCache();\r\n }\r\n\r\n /**\r\n * 获取缓存统计信息\r\n */\r\n getCacheStats() {\r\n return this.getClient().getCacheStats();\r\n }\r\n\r\n /**\r\n * 1. 便捷方法:根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string) {\r\n return this.articles.getArticle(articleId);\r\n }\r\n\r\n /**\r\n * 2. 便捷方法:获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string) {\r\n return this.articles.getCategories(rootCategoryId);\r\n }\r\n\r\n /**\r\n * 3. 便捷方法:获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string) {\r\n return this.articles.getTags(tagAlias);\r\n }\r\n\r\n /**\r\n * 4. 便捷方法:根据分类ID获取文章列表\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions) {\r\n return this.articles.getArticlesByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 5. 便捷方法:根据标签ID获取文章列表\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions) {\r\n return this.articles.getArticlesByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 6. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getCategoryPath(categoryId: number) {\r\n return this.articles.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 7. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.articles.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 8. 便捷方法:根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string) {\r\n return this.products.getProduct(productId);\r\n }\r\n\r\n /**\r\n * 9. 便捷方法:获取产品分类列表\r\n */\r\n async getProductCategories(productRootCategoryId?: number | string) {\r\n return this.products.getCategories(productRootCategoryId);\r\n }\r\n\r\n /**\r\n * 10. 便捷方法:获取产品标签列表\r\n */\r\n async getProductTags(productTagAlias?: string) {\r\n return this.products.getTags(productTagAlias);\r\n }\r\n\r\n /**\r\n * 11. 便捷方法:根据分类ID获取产品列表\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions) {\r\n return this.products.getProductsByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 12. 便捷方法:根据标签ID获取产品列表\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions) {\r\n return this.products.getProductsByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 13. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getProductCategoryPath(categoryId: number) {\r\n return this.products.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 14. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getProductSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.products.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 15. 便捷方法:获取税费信息\r\n */\r\n async getTaxInfo() {\r\n return this.products.getTaxInfo();\r\n }\r\n\r\n /**\r\n * 16. 便捷方法:获取运费信息\r\n */\r\n async getShippingInfo() {\r\n return this.products.getShippingInfo();\r\n }\r\n\r\n /**\r\n * 17. 便捷方法:获取区域信息\r\n */\r\n async getRegions() {\r\n return this.products.getRegions();\r\n }\r\n}\r\n\r\n// 导出所有类型和模块\r\nexport * from './core/types';\r\nexport * from './core/client';\r\nexport * from './modules/articles';\r\nexport * from './modules/products';\r\n\r\n// 默认导出\r\nexport default GT6SDK; "],"names":[],"mappings":";;;;AAycA;AACM,MAAO,QAAS,SAAQ,KAAK,CAAA;IACjC,WAAA,CACE,OAAe,EACR,UAAmB,EAAA;QAE1B,KAAK,CAAC,OAAO,CAAC;QAFP,IAAA,CAAA,UAAU,GAAV,UAAU;AAGjB,QAAA,IAAI,CAAC,IAAI,GAAG,UAA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H,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGnC;;AAEG;AACH,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;;AAGxC;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAEpC;;;;;;;;;"}
1
+ {"version":3,"file":"gt6-sdk.cjs.js","sources":["../src/core/types.ts","../src/core/client.ts","../src/modules/articles.ts","../src/modules/products.ts","../src/index.ts"],"sourcesContent":["// 基础配置类型\nexport interface GT6Config {\n baseUrl: string;\n apiKey?: string;\n platformId: string | number;\n rootCategoryId?: string | number;\n tagAlias?: string;\n // 产品专用配置字段\n productRootCategoryId?: string | number;\n productTagAlias?: string;\n version?: string;\n timeout?: number;\n cache?: {\n enabled: boolean;\n ttl: number; // 缓存时间(毫秒)\n };\n}\n\n// 分类相关类型\nexport interface Category {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n articleIds: number[];\n children: Category[];\n}\n\nexport interface CategoryResponse {\n platformId: number;\n categories: Category[];\n generatedAt: string;\n}\n\n// 产品分类相关类型\nexport interface ProductCategory {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n productIds: number[];\n children: ProductCategory[];\n}\n\nexport interface ProductCategoryResponse {\n platformId: number;\n categories: ProductCategory[];\n generatedAt: string;\n}\n\n// 标签相关类型\nexport interface Tag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n articleIds: number[];\n}\n\nexport interface TagResponse {\n platformId: number;\n tags: Tag[];\n generatedAt: string;\n}\n\n// 产品标签相关类型\nexport interface ProductTag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n productIds: number[];\n}\n\nexport interface ProductTagResponse {\n platformId: number;\n tags: ProductTag[];\n generatedAt: string;\n}\n\n// 文章元数据类型\nexport interface ArticleMetaData {\n metaId: number;\n articleId: number;\n metaKey: string;\n metaValue: string;\n type: number;\n templateId: number;\n groupId: number;\n sortOrder: number;\n aiId: number;\n fieldId: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章图片类型\nexport interface ArticleImage {\n imageId: number;\n articleId: number;\n metaId: number | null;\n imageUrl: string;\n imageType: 'cover' | 'content';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章类型\nexport interface Article {\n articleId: number;\n title: string;\n content: string;\n status: 'published' | 'draft' | 'archived';\n publishedAt: string;\n templateId: number;\n aiId: number;\n platformId: number;\n isVisible: boolean;\n displayTemplate: string;\n createdAt: any;\n updatedAt: any;\n categories: Category[];\n tags: Tag[];\n metaData: ArticleMetaData[];\n images: ArticleImage[];\n generatedAt: string;\n}\n\n// 产品详情类型\nexport interface ProductDetail {\n detailId: number;\n productId: number;\n detailKey: string;\n detailValue: string;\n extraInfo: string;\n}\n\n// 产品选项值类型\nexport interface ProductOptionValue {\n valueId: number;\n optionId: number;\n value: string;\n description: string;\n priceAdjustment: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品选项类型\nexport interface ProductOption {\n optionId: number;\n productId: number;\n optionName: string;\n createdAt: any;\n updatedAt: any;\n values: ProductOptionValue[];\n}\n\n// 产品变体类型\nexport interface ProductVariant {\n variantId: number;\n productId: number;\n sku: string;\n price: string;\n stock: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品图片类型\nexport interface ProductImage {\n imageId: number;\n productId: number;\n productDetailId: number | null;\n optionValueId: number | null;\n imageUrl: string;\n imageType: 'gallery' | 'thumbnail' | 'detail';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 地区类型\nexport interface Region {\n regionId: number;\n platformId: number;\n regionCode: string;\n regionName: string;\n regionLevel: string;\n parentId: number;\n children?: Region[];\n}\n\n// 运费规则类型\nexport interface ShippingRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n firstUnit: string;\n firstFee: string;\n additionalUnit: string;\n additionalFee: string;\n conditionType: string;\n conditionValue: string | null;\n createTime: any;\n updateTime: any;\n}\n\n// 运费模板类型\nexport interface ShippingTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultFee: string;\n freeShippingLimit: string;\n createTime: any;\n updateTime: any;\n rules: ShippingRule[];\n}\n\n// 运费响应类型\nexport interface ShippingResponse {\n platformId: number;\n templates: ShippingTemplate[];\n generatedAt: string;\n}\n\n// 税费规则类型\nexport interface TaxRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n taxRate: string;\n createTime: any;\n updateTime: any;\n}\n\n// 税费模板类型\nexport interface TaxTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultTaxRate: string;\n createTime: any;\n updateTime: any;\n rules: TaxRule[];\n}\n\n// 税费响应类型\nexport interface TaxResponse {\n platformId: number;\n templates: TaxTemplate[];\n generatedAt: string;\n}\n\n// 订阅类型\nexport interface Subscription {\n subscriptionId: number;\n productId: number;\n billingCycle: number;\n billingCycleUnit: string;\n billingCycleCount: number;\n setupFee: string;\n trialDays: number;\n trialPrice: string;\n renewalDiscount: string;\n autoRenew: boolean;\n allowCancel: boolean;\n cancelPolicy: string;\n refundPolicy: string;\n maxCycles: number;\n gracePeriod: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 批发类型\nexport interface Wholesale {\n wholesaleId: number;\n productId: number;\n minOrderQuantity: number;\n maxOrderQuantity: number;\n allowMixedVariants: boolean;\n showRetailPrice: boolean;\n wholesaleDescription: string;\n paymentTerms: string;\n shippingTerms: string;\n}\n\n// 价格层级类型\nexport interface PriceTier {\n tierId: number;\n wholesaleId: number;\n userLevel: number | null;\n minQuantity: number;\n maxQuantity: number;\n priceType: number;\n priceValue: string;\n sortOrder: number;\n}\n\n// 变体价格类型\nexport interface VariantPrice {\n id: number;\n wholesaleId: number;\n tierId: number;\n variantId: number;\n priceType: number;\n priceValue: string;\n}\n\n// 众筹类型\nexport interface Crowdfunding {\n crowdfundingId: number;\n productId: number;\n targetAmount: string;\n currentAmount: string;\n supporterCount: number;\n startTime: any;\n endTime: any;\n status: number;\n minSupportAmount: string;\n allowOverFunding: boolean;\n overFundingLimit: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹奖励类型\nexport interface Reward {\n rewardId: number;\n crowdfundingId: number;\n variantId: number;\n rewardName: string;\n rewardDescription: string;\n rewardAmount: string;\n rewardLimit: number;\n rewardClaimed: number;\n shippingRequired: boolean;\n estimatedDeliveryTime: any;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹更新类型\nexport interface CrowdfundingUpdate {\n updateId: number;\n crowdfundingId: number;\n updateTitle: string;\n updateContent: string;\n isPublic: boolean;\n updateTime: any;\n}\n\n// 众筹FAQ类型\nexport interface CrowdfundingFAQ {\n faqId: number;\n crowdfundingId: number;\n question: string;\n answer: string;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 简单理财类型\nexport interface SimpleFinance {\n simpleFinanceId: number;\n productId: number;\n calculationPeriod: number;\n calculationPeriodUnit: string;\n interestRate: string;\n minInvestment: string;\n maxInvestment: string;\n minInvestmentUnit: string;\n maxInvestmentUnit: string;\n investmentPeriod: number;\n investmentPeriodUnit: string;\n}\n\n// 产品类型\nexport interface Product {\n productId: number;\n productName: string;\n description: string;\n metaKeywords: string;\n price: string;\n priceChangePercent: string;\n status: number;\n productType: number;\n native: number;\n shared: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n oldProductId: number | null;\n details: ProductDetail[];\n options: ProductOption[];\n variants: ProductVariant[];\n images: ProductImage[];\n categories: ProductCategory[];\n tags: ProductTag[];\n regions: Region[];\n shippingTemplates: ShippingTemplate[];\n taxTemplates: TaxTemplate[];\n subscription?: Subscription; // 当productType为2时存在\n wholesale?: Wholesale; // 当productType为3时存在\n priceTiers?: PriceTier[]; // 当productType为3时存在\n variantPrices?: VariantPrice[]; // 当productType为3时存在\n crowdfunding?: Crowdfunding; // 当productType为4时存在\n rewards?: Reward[]; // 当productType为4时存在\n updates?: CrowdfundingUpdate[]; // 当productType为4时存在\n faqs?: CrowdfundingFAQ[]; // 当productType为4时存在\n simpleFinance?: SimpleFinance; // 当productType为5时存在\n generatedAt: string;\n}\n\n// 文章列表项类型(简化版)\nexport interface ArticleListItem {\n articleId: number;\n title: string;\n status: string;\n publishedAt: string;\n categories: Category[];\n tags: Tag[];\n coverImage?: string;\n}\n\n// 产品列表项类型(简化版)\nexport interface ProductListItem {\n productId: number;\n productName: string;\n price: string;\n status: number;\n categories: ProductCategory[];\n tags: ProductTag[];\n coverImage?: string;\n}\n\n// 错误类型\nexport class GT6Error extends Error {\n constructor(\n message: string,\n public statusCode?: number\n ) {\n super(message);\n this.name = 'GT6Error';\n }\n}\n\n// 查询参数类型\nexport interface ArticleQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: string;\n limit?: number;\n offset?: number;\n sortBy?: 'publishedAt' | 'title' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 产品查询参数类型\nexport interface ProductQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: number;\n limit?: number;\n offset?: number;\n sortBy?: 'price' | 'productName' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 根据标签获取文章的选项类型\nexport interface ArticlesByTagOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n tagAlias?: string;\n}\n\n// 根据分类获取文章的选项类型\nexport interface ArticlesByCategoryOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n}\n\n// 根据标签获取产品的选项类型\nexport interface ProductsByTagOptions {\n page?: number;\n limit?: number;\n status?: number;\n productTagAlias?: string;\n}\n\n// 根据分类获取产品的选项类型\nexport interface ProductsByCategoryOptions {\n page?: number;\n limit?: number;\n status?: number;\n}\n\n// 文章统计类型\nexport interface ArticleStats {\n total: number;\n published: number;\n draft: number;\n archived: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\n// 产品统计类型\nexport interface ProductStats {\n total: number;\n active: number;\n inactive: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\nexport interface GT6Response<T> {\n success: boolean;\n data: T;\n error?: string;\n}\n\nexport interface ArticleResponse {\n article: Article;\n}\n\nexport interface ProductResponse {\n product: Product;\n}\n\nexport interface CategoryResponse {\n categories: Category[];\n}\n\nexport interface ProductCategoryResponse {\n categories: ProductCategory[];\n}\n\nexport interface TagResponse {\n tags: Tag[];\n}\n\nexport interface ProductTagResponse {\n tags: ProductTag[];\n}\n\n// 区域响应类型\nexport interface RegionResponse {\n platformId: number;\n regions: Region[];\n generatedAt: string;\n} ","import { GT6Config, GT6Error } from './types';\r\n\r\nexport class GT6Client {\r\n private config: GT6Config;\r\n private cache: Map<string, { data: any; timestamp: number }>;\r\n\r\n constructor(config: GT6Config) {\r\n this.config = {\r\n timeout: 10000,\r\n cache: {\r\n enabled: true,\r\n ttl: 300000 // 5分钟默认缓存\r\n },\r\n ...config\r\n };\r\n this.cache = new Map();\r\n }\r\n\r\n /**\r\n * 发起HTTP请求\r\n */\r\n async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {\r\n const url = `${this.config.baseUrl}${endpoint}`;\r\n const cacheKey = `${options.method || 'GET'}:${url}`;\r\n\r\n // 检查缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n const cached = this.cache.get(cacheKey);\r\n if (cached && Date.now() - cached.timestamp < this.config.cache.ttl) {\r\n return cached.data;\r\n }\r\n }\r\n\r\n try {\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\r\n\r\n const response = await fetch(url, {\r\n ...options,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...options.headers,\r\n },\r\n signal: controller.signal\r\n });\r\n\r\n clearTimeout(timeoutId);\r\n\r\n if (!response.ok) {\r\n throw new GT6Error(\r\n `HTTP ${response.status}: ${response.statusText}`,\r\n response.status\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n\r\n // 更新缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n this.cache.set(cacheKey, { data, timestamp: Date.now() });\r\n }\r\n\r\n return data;\r\n } catch (error: any) {\r\n if (error instanceof GT6Error) {\r\n throw error;\r\n }\r\n \r\n if (error.name === 'AbortError') {\r\n throw new GT6Error('Request timeout', 408);\r\n }\r\n \r\n throw new GT6Error(`Network error: ${error.message}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取配置\r\n */\r\n getConfig(): GT6Config {\r\n return { ...this.config };\r\n }\r\n\r\n /**\r\n * 清除缓存\r\n */\r\n clearCache(): void {\r\n this.cache.clear();\r\n }\r\n\r\n /**\r\n * 获取缓存统计\r\n */\r\n getCacheStats(): { size: number; entries: Array<{ key: string; age: number }> } {\r\n const entries = Array.from(this.cache.entries()).map(([key, value]) => ({\r\n key,\r\n age: Date.now() - value.timestamp\r\n }));\r\n\r\n return {\r\n size: this.cache.size,\r\n entries\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Article,\r\n Category,\r\n Tag,\r\n CategoryResponse,\r\n TagResponse,\r\n ArticlesByTagOptions,\r\n ArticlesByCategoryOptions\r\n} from '../core/types';\r\n\r\nexport class ArticlesAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string): Promise<Article> {\r\n return this.client.request<Article>(`/articles/${articleId}.json`);\r\n }\r\n\r\n /**\r\n * 2. 获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string): Promise<Category[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = rootCategoryId || config.rootCategoryId || '671920';\r\n \r\n const response = await this.client.request<CategoryResponse>(\r\n `/article-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string): Promise<Tag[]> {\r\n const config = this.client.getConfig();\r\n const alias = tagAlias || config.tagAlias || '001';\r\n \r\n const response = await this.client.request<TagResponse>(\r\n `/article-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取文章列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allArticleIds.push(...targetCategory.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取文章列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递tagAlias参数\r\n const tags = await this.getTags(options?.tagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allArticleIds.push(...targetTag.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: Category[];\r\n currentCategory: Category | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: Category[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: Category, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: Category[];\r\n currentCategory: Category | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: Category[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Product,\r\n ProductCategory,\r\n ProductTag,\r\n ProductCategoryResponse,\r\n ProductTagResponse,\r\n ProductsByTagOptions,\r\n ProductsByCategoryOptions,\r\n TaxResponse,\r\n ShippingResponse,\r\n RegionResponse\r\n} from '../core/types';\r\n\r\nexport class ProductsAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string): Promise<Product> {\r\n const product = await this.client.request<Product>(`/products/${productId}.json`);\r\n \r\n // 检查产品是否有销售区域和税费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.taxTemplates && product.taxTemplates.length > 0) {\r\n try {\r\n // 获取税费信息\r\n const taxInfo = await this.getTaxInfo();\r\n \r\n // 为每个税费模板添加规则\r\n product.taxTemplates = product.taxTemplates.map(template => {\r\n const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取税费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch tax info:', error);\r\n }\r\n }\r\n \r\n // 检查产品是否有销售区域和运费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.shippingTemplates && product.shippingTemplates.length > 0) {\r\n try {\r\n // 获取运费信息\r\n const shippingInfo = await this.getShippingInfo();\r\n \r\n // 为每个运费模板添加规则\r\n product.shippingTemplates = product.shippingTemplates.map(template => {\r\n const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取运费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch shipping info:', error);\r\n }\r\n }\r\n \r\n return product;\r\n }\r\n\r\n /**\r\n * 2. 获取产品分类列表\r\n */\r\n async getCategories(productRootCategoryId?: number | string): Promise<ProductCategory[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = productRootCategoryId || config.productRootCategoryId || '277233';\r\n \r\n const response = await this.client.request<ProductCategoryResponse>(\r\n `/product-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取产品标签列表\r\n */\r\n async getTags(productTagAlias?: string): Promise<ProductTag[]> {\r\n const config = this.client.getConfig();\r\n const alias = productTagAlias || config.productTagAlias || '01';\r\n \r\n const response = await this.client.request<ProductTagResponse>(\r\n `/product-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取产品列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = findCategoryById(categories, id);\r\n if (targetCategory) {\r\n allProductIds.push(...targetCategory.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取产品列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递productTagAlias参数\r\n const tags = await this.getTags(options?.productTagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allProductIds.push(...targetTag.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找目标分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 查找目标分类(包括子分类)\r\n const targetCategory = findCategoryById(categories, categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: ProductCategory[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类的函数\r\n const buildPath = (currentCategory: ProductCategory, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = findCategoryById(categories, currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 查找目标分类(包括子分类)\r\n const targetCategory = findCategoryById(categories, categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: ProductCategory[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 递归查找直接子分类\r\n const findChildren = (cats: ProductCategory[], parentId: number): ProductCategory[] => {\r\n const children: ProductCategory[] = [];\r\n for (const cat of cats) {\r\n if (cat.parentId === parentId) {\r\n children.push(cat);\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n children.push(...findChildren(cat.children, parentId));\r\n }\r\n }\r\n return children;\r\n };\r\n \r\n const children = findChildren(categories, parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n\r\n /**\r\n * 8. 获取税费信息\r\n * 获取平台的所有税费模板和规则\r\n */\r\n async getTaxInfo(): Promise<TaxResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<TaxResponse>(`/tax/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 9. 获取运费信息\r\n * 获取平台的所有运费模板和规则\r\n */\r\n async getShippingInfo(): Promise<ShippingResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<ShippingResponse>(`/shipping/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 10. 获取区域信息\r\n * 获取平台的所有区域信息,包括层级结构\r\n */\r\n async getRegions(): Promise<RegionResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<RegionResponse>(`/regions/platform-${config.platformId}.json`);\r\n }\r\n} ","import { GT6Client } from './core/client';\r\nimport { ArticlesAPI } from './modules/articles';\r\nimport { ProductsAPI } from './modules/products';\r\nimport { \r\n GT6Config, \r\n ArticlesByCategoryOptions, \r\n ArticlesByTagOptions,\r\n ProductsByCategoryOptions,\r\n ProductsByTagOptions\r\n} from './core/types';\r\n\r\n/**\r\n * GT6 SDK 主类\r\n * 提供文章和产品管理相关的所有功能\r\n */\r\nexport class GT6SDK {\r\n public articles: ArticlesAPI;\r\n public products: ProductsAPI;\r\n\r\n constructor(config: GT6Config) {\r\n const client = new GT6Client(config);\r\n this.articles = new ArticlesAPI(client);\r\n this.products = new ProductsAPI(client);\r\n }\r\n\r\n /**\r\n * 获取客户端实例(用于高级用法)\r\n */\r\n getClient(): GT6Client {\r\n return (this.articles as any).client;\r\n }\r\n\r\n /**\r\n * 清除所有缓存\r\n */\r\n clearCache(): void {\r\n this.getClient().clearCache();\r\n }\r\n\r\n /**\r\n * 获取缓存统计信息\r\n */\r\n getCacheStats() {\r\n return this.getClient().getCacheStats();\r\n }\r\n\r\n /**\r\n * 1. 便捷方法:根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string) {\r\n return this.articles.getArticle(articleId);\r\n }\r\n\r\n /**\r\n * 2. 便捷方法:获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string) {\r\n return this.articles.getCategories(rootCategoryId);\r\n }\r\n\r\n /**\r\n * 3. 便捷方法:获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string) {\r\n return this.articles.getTags(tagAlias);\r\n }\r\n\r\n /**\r\n * 4. 便捷方法:根据分类ID获取文章列表\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions) {\r\n return this.articles.getArticlesByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 5. 便捷方法:根据标签ID获取文章列表\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions) {\r\n return this.articles.getArticlesByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 6. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getCategoryPath(categoryId: number) {\r\n return this.articles.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 7. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.articles.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 8. 便捷方法:根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string) {\r\n return this.products.getProduct(productId);\r\n }\r\n\r\n /**\r\n * 9. 便捷方法:获取产品分类列表\r\n */\r\n async getProductCategories(productRootCategoryId?: number | string) {\r\n return this.products.getCategories(productRootCategoryId);\r\n }\r\n\r\n /**\r\n * 10. 便捷方法:获取产品标签列表\r\n */\r\n async getProductTags(productTagAlias?: string) {\r\n return this.products.getTags(productTagAlias);\r\n }\r\n\r\n /**\r\n * 11. 便捷方法:根据分类ID获取产品列表\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions) {\r\n return this.products.getProductsByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 12. 便捷方法:根据标签ID获取产品列表\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions) {\r\n return this.products.getProductsByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 13. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getProductCategoryPath(categoryId: number) {\r\n return this.products.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 14. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getProductSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.products.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 15. 便捷方法:获取税费信息\r\n */\r\n async getTaxInfo() {\r\n return this.products.getTaxInfo();\r\n }\r\n\r\n /**\r\n * 16. 便捷方法:获取运费信息\r\n */\r\n async getShippingInfo() {\r\n return this.products.getShippingInfo();\r\n }\r\n\r\n /**\r\n * 17. 便捷方法:获取区域信息\r\n */\r\n async getRegions() {\r\n return this.products.getRegions();\r\n }\r\n}\r\n\r\n// 导出所有类型和模块\r\nexport * from './core/types';\r\nexport * from './core/client';\r\nexport * from './modules/articles';\r\nexport * from './modules/products';\r\n\r\n// 默认导出\r\nexport default GT6SDK; "],"names":[],"mappings":";;;;AAycA;AACM,MAAO,QAAS,SAAQ,KAAK,CAAA;IACjC,WAAA,CACE,OAAe,EACR,UAAmB,EAAA;QAE1B,KAAK,CAAC,OAAO,CAAC;QAFP,IAAA,CAAA,UAAU,GAAV,UAAU;AAGjB,QAAA,IAAI,CAAC,IAAI,GAAG,UAAU;;AAEzB;;MChdY,SAAS,CAAA;AAIpB,IAAA,WAAA,CAAY,MAAiB,EAAA;QAC3B,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,OAAO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AC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;;AAGvD;;AAEG;IACH,MAAM,sBAAsB,CAAC,UAAkB,EAAA;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC;;AAGlD;;AAEG;AACH,IAAA,MAAM,uBAAuB,CAAC,UAAkB,EAAE,OAIjD,EAAA;QACC,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC;;AAG5D;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGnC;;AAEG;AACH,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;;AAGxC;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAEpC;;;;;;;;;"}
@@ -395,12 +395,26 @@ class ProductsAPI {
395
395
  async getProductsByCategory(categoryId, options) {
396
396
  // 获取分类数据
397
397
  const categories = await this.getCategories();
398
+ // 递归查找分类的函数
399
+ const findCategoryById = (cats, targetId) => {
400
+ for (const cat of cats) {
401
+ if (cat.categoryId === targetId) {
402
+ return cat;
403
+ }
404
+ if (cat.children && cat.children.length > 0) {
405
+ const found = findCategoryById(cat.children, targetId);
406
+ if (found)
407
+ return found;
408
+ }
409
+ }
410
+ return null;
411
+ };
398
412
  // 将单个分类ID转换为数组
399
413
  const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
400
414
  // 收集所有指定分类下的产品ID
401
415
  const allProductIds = [];
402
416
  categoryIds.forEach(id => {
403
- const targetCategory = categories.find(cat => cat.categoryId === id);
417
+ const targetCategory = findCategoryById(categories, id);
404
418
  if (targetCategory) {
405
419
  allProductIds.push(...targetCategory.productIds);
406
420
  }
@@ -487,8 +501,22 @@ class ProductsAPI {
487
501
  async getCategoryPath(categoryId) {
488
502
  // 获取所有分类数据
489
503
  const categories = await this.getCategories();
490
- // 查找目标分类
491
- const targetCategory = categories.find(cat => cat.categoryId === categoryId);
504
+ // 递归查找目标分类的函数
505
+ const findCategoryById = (cats, targetId) => {
506
+ for (const cat of cats) {
507
+ if (cat.categoryId === targetId) {
508
+ return cat;
509
+ }
510
+ if (cat.children && cat.children.length > 0) {
511
+ const found = findCategoryById(cat.children, targetId);
512
+ if (found)
513
+ return found;
514
+ }
515
+ }
516
+ return null;
517
+ };
518
+ // 查找目标分类(包括子分类)
519
+ const targetCategory = findCategoryById(categories, categoryId);
492
520
  if (!targetCategory) {
493
521
  return {
494
522
  path: [],
@@ -499,7 +527,7 @@ class ProductsAPI {
499
527
  // 构建分类路径
500
528
  const path = [];
501
529
  const breadcrumbs = [];
502
- // 递归查找父分类
530
+ // 递归查找父分类的函数
503
531
  const buildPath = (currentCategory, level = 0) => {
504
532
  // 将当前分类添加到路径开头(因为我们要从根到叶子构建)
505
533
  path.unshift(currentCategory);
@@ -510,7 +538,7 @@ class ProductsAPI {
510
538
  });
511
539
  // 如果有父分类,继续递归
512
540
  if (currentCategory.parentId && currentCategory.parentId !== 0) {
513
- const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);
541
+ const parentCategory = findCategoryById(categories, currentCategory.parentId);
514
542
  if (parentCategory) {
515
543
  buildPath(parentCategory, level + 1);
516
544
  }
@@ -531,8 +559,22 @@ class ProductsAPI {
531
559
  async getSubCategories(categoryId, options) {
532
560
  // 获取所有分类数据
533
561
  const categories = await this.getCategories();
534
- // 查找目标分类
535
- const targetCategory = categories.find(cat => cat.categoryId === categoryId);
562
+ // 递归查找分类的函数
563
+ const findCategoryById = (cats, targetId) => {
564
+ for (const cat of cats) {
565
+ if (cat.categoryId === targetId) {
566
+ return cat;
567
+ }
568
+ if (cat.children && cat.children.length > 0) {
569
+ const found = findCategoryById(cat.children, targetId);
570
+ if (found)
571
+ return found;
572
+ }
573
+ }
574
+ return null;
575
+ };
576
+ // 查找目标分类(包括子分类)
577
+ const targetCategory = findCategoryById(categories, categoryId);
536
578
  if (!targetCategory) {
537
579
  return {
538
580
  subCategories: [],
@@ -549,8 +591,20 @@ class ProductsAPI {
549
591
  if (currentDepth >= maxDepth) {
550
592
  return;
551
593
  }
552
- // 查找直接子分类
553
- const children = categories.filter(cat => cat.parentId === parentId);
594
+ // 递归查找直接子分类
595
+ const findChildren = (cats, parentId) => {
596
+ const children = [];
597
+ for (const cat of cats) {
598
+ if (cat.parentId === parentId) {
599
+ children.push(cat);
600
+ }
601
+ if (cat.children && cat.children.length > 0) {
602
+ children.push(...findChildren(cat.children, parentId));
603
+ }
604
+ }
605
+ return children;
606
+ };
607
+ const children = findChildren(categories, parentId);
554
608
  children.forEach(child => {
555
609
  subCategories.push(child);
556
610
  // 如果需要递归且未达到最大深度,继续查找子分类
@@ -1 +1 @@
1
- {"version":3,"file":"gt6-sdk.esm.js","sources":["../src/core/types.ts","../src/core/client.ts","../src/modules/articles.ts","../src/modules/products.ts","../src/index.ts"],"sourcesContent":["// 基础配置类型\nexport interface GT6Config {\n baseUrl: string;\n apiKey?: string;\n platformId: string | number;\n rootCategoryId?: string | number;\n tagAlias?: string;\n // 产品专用配置字段\n productRootCategoryId?: string | number;\n productTagAlias?: string;\n version?: string;\n timeout?: number;\n cache?: {\n enabled: boolean;\n ttl: number; // 缓存时间(毫秒)\n };\n}\n\n// 分类相关类型\nexport interface Category {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n articleIds: number[];\n children: Category[];\n}\n\nexport interface CategoryResponse {\n platformId: number;\n categories: Category[];\n generatedAt: string;\n}\n\n// 产品分类相关类型\nexport interface ProductCategory {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n productIds: number[];\n children: ProductCategory[];\n}\n\nexport interface ProductCategoryResponse {\n platformId: number;\n categories: ProductCategory[];\n generatedAt: string;\n}\n\n// 标签相关类型\nexport interface Tag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n articleIds: number[];\n}\n\nexport interface TagResponse {\n platformId: number;\n tags: Tag[];\n generatedAt: string;\n}\n\n// 产品标签相关类型\nexport interface ProductTag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n productIds: number[];\n}\n\nexport interface ProductTagResponse {\n platformId: number;\n tags: ProductTag[];\n generatedAt: string;\n}\n\n// 文章元数据类型\nexport interface ArticleMetaData {\n metaId: number;\n articleId: number;\n metaKey: string;\n metaValue: string;\n type: number;\n templateId: number;\n groupId: number;\n sortOrder: number;\n aiId: number;\n fieldId: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章图片类型\nexport interface ArticleImage {\n imageId: number;\n articleId: number;\n metaId: number | null;\n imageUrl: string;\n imageType: 'cover' | 'content';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章类型\nexport interface Article {\n articleId: number;\n title: string;\n content: string;\n status: 'published' | 'draft' | 'archived';\n publishedAt: string;\n templateId: number;\n aiId: number;\n platformId: number;\n isVisible: boolean;\n displayTemplate: string;\n createdAt: any;\n updatedAt: any;\n categories: Category[];\n tags: Tag[];\n metaData: ArticleMetaData[];\n images: ArticleImage[];\n generatedAt: string;\n}\n\n// 产品详情类型\nexport interface ProductDetail {\n detailId: number;\n productId: number;\n detailKey: string;\n detailValue: string;\n extraInfo: string;\n}\n\n// 产品选项值类型\nexport interface ProductOptionValue {\n valueId: number;\n optionId: number;\n value: string;\n description: string;\n priceAdjustment: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品选项类型\nexport interface ProductOption {\n optionId: number;\n productId: number;\n optionName: string;\n createdAt: any;\n updatedAt: any;\n values: ProductOptionValue[];\n}\n\n// 产品变体类型\nexport interface ProductVariant {\n variantId: number;\n productId: number;\n sku: string;\n price: string;\n stock: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品图片类型\nexport interface ProductImage {\n imageId: number;\n productId: number;\n productDetailId: number | null;\n optionValueId: number | null;\n imageUrl: string;\n imageType: 'gallery' | 'thumbnail' | 'detail';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 地区类型\nexport interface Region {\n regionId: number;\n platformId: number;\n regionCode: string;\n regionName: string;\n regionLevel: string;\n parentId: number;\n children?: Region[];\n}\n\n// 运费规则类型\nexport interface ShippingRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n firstUnit: string;\n firstFee: string;\n additionalUnit: string;\n additionalFee: string;\n conditionType: string;\n conditionValue: string | null;\n createTime: any;\n updateTime: any;\n}\n\n// 运费模板类型\nexport interface ShippingTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultFee: string;\n freeShippingLimit: string;\n createTime: any;\n updateTime: any;\n rules: ShippingRule[];\n}\n\n// 运费响应类型\nexport interface ShippingResponse {\n platformId: number;\n templates: ShippingTemplate[];\n generatedAt: string;\n}\n\n// 税费规则类型\nexport interface TaxRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n taxRate: string;\n createTime: any;\n updateTime: any;\n}\n\n// 税费模板类型\nexport interface TaxTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultTaxRate: string;\n createTime: any;\n updateTime: any;\n rules: TaxRule[];\n}\n\n// 税费响应类型\nexport interface TaxResponse {\n platformId: number;\n templates: TaxTemplate[];\n generatedAt: string;\n}\n\n// 订阅类型\nexport interface Subscription {\n subscriptionId: number;\n productId: number;\n billingCycle: number;\n billingCycleUnit: string;\n billingCycleCount: number;\n setupFee: string;\n trialDays: number;\n trialPrice: string;\n renewalDiscount: string;\n autoRenew: boolean;\n allowCancel: boolean;\n cancelPolicy: string;\n refundPolicy: string;\n maxCycles: number;\n gracePeriod: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 批发类型\nexport interface Wholesale {\n wholesaleId: number;\n productId: number;\n minOrderQuantity: number;\n maxOrderQuantity: number;\n allowMixedVariants: boolean;\n showRetailPrice: boolean;\n wholesaleDescription: string;\n paymentTerms: string;\n shippingTerms: string;\n}\n\n// 价格层级类型\nexport interface PriceTier {\n tierId: number;\n wholesaleId: number;\n userLevel: number | null;\n minQuantity: number;\n maxQuantity: number;\n priceType: number;\n priceValue: string;\n sortOrder: number;\n}\n\n// 变体价格类型\nexport interface VariantPrice {\n id: number;\n wholesaleId: number;\n tierId: number;\n variantId: number;\n priceType: number;\n priceValue: string;\n}\n\n// 众筹类型\nexport interface Crowdfunding {\n crowdfundingId: number;\n productId: number;\n targetAmount: string;\n currentAmount: string;\n supporterCount: number;\n startTime: any;\n endTime: any;\n status: number;\n minSupportAmount: string;\n allowOverFunding: boolean;\n overFundingLimit: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹奖励类型\nexport interface Reward {\n rewardId: number;\n crowdfundingId: number;\n variantId: number;\n rewardName: string;\n rewardDescription: string;\n rewardAmount: string;\n rewardLimit: number;\n rewardClaimed: number;\n shippingRequired: boolean;\n estimatedDeliveryTime: any;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹更新类型\nexport interface CrowdfundingUpdate {\n updateId: number;\n crowdfundingId: number;\n updateTitle: string;\n updateContent: string;\n isPublic: boolean;\n updateTime: any;\n}\n\n// 众筹FAQ类型\nexport interface CrowdfundingFAQ {\n faqId: number;\n crowdfundingId: number;\n question: string;\n answer: string;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 简单理财类型\nexport interface SimpleFinance {\n simpleFinanceId: number;\n productId: number;\n calculationPeriod: number;\n calculationPeriodUnit: string;\n interestRate: string;\n minInvestment: string;\n maxInvestment: string;\n minInvestmentUnit: string;\n maxInvestmentUnit: string;\n investmentPeriod: number;\n investmentPeriodUnit: string;\n}\n\n// 产品类型\nexport interface Product {\n productId: number;\n productName: string;\n description: string;\n metaKeywords: string;\n price: string;\n priceChangePercent: string;\n status: number;\n productType: number;\n native: number;\n shared: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n oldProductId: number | null;\n details: ProductDetail[];\n options: ProductOption[];\n variants: ProductVariant[];\n images: ProductImage[];\n categories: ProductCategory[];\n tags: ProductTag[];\n regions: Region[];\n shippingTemplates: ShippingTemplate[];\n taxTemplates: TaxTemplate[];\n subscription?: Subscription; // 当productType为2时存在\n wholesale?: Wholesale; // 当productType为3时存在\n priceTiers?: PriceTier[]; // 当productType为3时存在\n variantPrices?: VariantPrice[]; // 当productType为3时存在\n crowdfunding?: Crowdfunding; // 当productType为4时存在\n rewards?: Reward[]; // 当productType为4时存在\n updates?: CrowdfundingUpdate[]; // 当productType为4时存在\n faqs?: CrowdfundingFAQ[]; // 当productType为4时存在\n simpleFinance?: SimpleFinance; // 当productType为5时存在\n generatedAt: string;\n}\n\n// 文章列表项类型(简化版)\nexport interface ArticleListItem {\n articleId: number;\n title: string;\n status: string;\n publishedAt: string;\n categories: Category[];\n tags: Tag[];\n coverImage?: string;\n}\n\n// 产品列表项类型(简化版)\nexport interface ProductListItem {\n productId: number;\n productName: string;\n price: string;\n status: number;\n categories: ProductCategory[];\n tags: ProductTag[];\n coverImage?: string;\n}\n\n// 错误类型\nexport class GT6Error extends Error {\n constructor(\n message: string,\n public statusCode?: number\n ) {\n super(message);\n this.name = 'GT6Error';\n }\n}\n\n// 查询参数类型\nexport interface ArticleQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: string;\n limit?: number;\n offset?: number;\n sortBy?: 'publishedAt' | 'title' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 产品查询参数类型\nexport interface ProductQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: number;\n limit?: number;\n offset?: number;\n sortBy?: 'price' | 'productName' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 根据标签获取文章的选项类型\nexport interface ArticlesByTagOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n tagAlias?: string;\n}\n\n// 根据分类获取文章的选项类型\nexport interface ArticlesByCategoryOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n}\n\n// 根据标签获取产品的选项类型\nexport interface ProductsByTagOptions {\n page?: number;\n limit?: number;\n status?: number;\n productTagAlias?: string;\n}\n\n// 根据分类获取产品的选项类型\nexport interface ProductsByCategoryOptions {\n page?: number;\n limit?: number;\n status?: number;\n}\n\n// 文章统计类型\nexport interface ArticleStats {\n total: number;\n published: number;\n draft: number;\n archived: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\n// 产品统计类型\nexport interface ProductStats {\n total: number;\n active: number;\n inactive: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\nexport interface GT6Response<T> {\n success: boolean;\n data: T;\n error?: string;\n}\n\nexport interface ArticleResponse {\n article: Article;\n}\n\nexport interface ProductResponse {\n product: Product;\n}\n\nexport interface CategoryResponse {\n categories: Category[];\n}\n\nexport interface ProductCategoryResponse {\n categories: ProductCategory[];\n}\n\nexport interface TagResponse {\n tags: Tag[];\n}\n\nexport interface ProductTagResponse {\n tags: ProductTag[];\n}\n\n// 区域响应类型\nexport interface RegionResponse {\n platformId: number;\n regions: Region[];\n generatedAt: string;\n} ","import { GT6Config, GT6Error } from './types';\r\n\r\nexport class GT6Client {\r\n private config: GT6Config;\r\n private cache: Map<string, { data: any; timestamp: number }>;\r\n\r\n constructor(config: GT6Config) {\r\n this.config = {\r\n timeout: 10000,\r\n cache: {\r\n enabled: true,\r\n ttl: 300000 // 5分钟默认缓存\r\n },\r\n ...config\r\n };\r\n this.cache = new Map();\r\n }\r\n\r\n /**\r\n * 发起HTTP请求\r\n */\r\n async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {\r\n const url = `${this.config.baseUrl}${endpoint}`;\r\n const cacheKey = `${options.method || 'GET'}:${url}`;\r\n\r\n // 检查缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n const cached = this.cache.get(cacheKey);\r\n if (cached && Date.now() - cached.timestamp < this.config.cache.ttl) {\r\n return cached.data;\r\n }\r\n }\r\n\r\n try {\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\r\n\r\n const response = await fetch(url, {\r\n ...options,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...options.headers,\r\n },\r\n signal: controller.signal\r\n });\r\n\r\n clearTimeout(timeoutId);\r\n\r\n if (!response.ok) {\r\n throw new GT6Error(\r\n `HTTP ${response.status}: ${response.statusText}`,\r\n response.status\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n\r\n // 更新缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n this.cache.set(cacheKey, { data, timestamp: Date.now() });\r\n }\r\n\r\n return data;\r\n } catch (error: any) {\r\n if (error instanceof GT6Error) {\r\n throw error;\r\n }\r\n \r\n if (error.name === 'AbortError') {\r\n throw new GT6Error('Request timeout', 408);\r\n }\r\n \r\n throw new GT6Error(`Network error: ${error.message}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取配置\r\n */\r\n getConfig(): GT6Config {\r\n return { ...this.config };\r\n }\r\n\r\n /**\r\n * 清除缓存\r\n */\r\n clearCache(): void {\r\n this.cache.clear();\r\n }\r\n\r\n /**\r\n * 获取缓存统计\r\n */\r\n getCacheStats(): { size: number; entries: Array<{ key: string; age: number }> } {\r\n const entries = Array.from(this.cache.entries()).map(([key, value]) => ({\r\n key,\r\n age: Date.now() - value.timestamp\r\n }));\r\n\r\n return {\r\n size: this.cache.size,\r\n entries\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Article,\r\n Category,\r\n Tag,\r\n CategoryResponse,\r\n TagResponse,\r\n ArticlesByTagOptions,\r\n ArticlesByCategoryOptions\r\n} from '../core/types';\r\n\r\nexport class ArticlesAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string): Promise<Article> {\r\n return this.client.request<Article>(`/articles/${articleId}.json`);\r\n }\r\n\r\n /**\r\n * 2. 获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string): Promise<Category[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = rootCategoryId || config.rootCategoryId || '671920';\r\n \r\n const response = await this.client.request<CategoryResponse>(\r\n `/article-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string): Promise<Tag[]> {\r\n const config = this.client.getConfig();\r\n const alias = tagAlias || config.tagAlias || '001';\r\n \r\n const response = await this.client.request<TagResponse>(\r\n `/article-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取文章列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allArticleIds.push(...targetCategory.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取文章列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递tagAlias参数\r\n const tags = await this.getTags(options?.tagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allArticleIds.push(...targetTag.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: Category[];\r\n currentCategory: Category | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: Category[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: Category, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: Category[];\r\n currentCategory: Category | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: Category[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Product,\r\n ProductCategory,\r\n ProductTag,\r\n ProductCategoryResponse,\r\n ProductTagResponse,\r\n ProductsByTagOptions,\r\n ProductsByCategoryOptions,\r\n TaxResponse,\r\n ShippingResponse,\r\n RegionResponse\r\n} from '../core/types';\r\n\r\nexport class ProductsAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string): Promise<Product> {\r\n const product = await this.client.request<Product>(`/products/${productId}.json`);\r\n \r\n // 检查产品是否有销售区域和税费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.taxTemplates && product.taxTemplates.length > 0) {\r\n try {\r\n // 获取税费信息\r\n const taxInfo = await this.getTaxInfo();\r\n \r\n // 为每个税费模板添加规则\r\n product.taxTemplates = product.taxTemplates.map(template => {\r\n const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取税费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch tax info:', error);\r\n }\r\n }\r\n \r\n // 检查产品是否有销售区域和运费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.shippingTemplates && product.shippingTemplates.length > 0) {\r\n try {\r\n // 获取运费信息\r\n const shippingInfo = await this.getShippingInfo();\r\n \r\n // 为每个运费模板添加规则\r\n product.shippingTemplates = product.shippingTemplates.map(template => {\r\n const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取运费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch shipping info:', error);\r\n }\r\n }\r\n \r\n return product;\r\n }\r\n\r\n /**\r\n * 2. 获取产品分类列表\r\n */\r\n async getCategories(productRootCategoryId?: number | string): Promise<ProductCategory[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = productRootCategoryId || config.productRootCategoryId || '277233';\r\n \r\n const response = await this.client.request<ProductCategoryResponse>(\r\n `/product-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取产品标签列表\r\n */\r\n async getTags(productTagAlias?: string): Promise<ProductTag[]> {\r\n const config = this.client.getConfig();\r\n const alias = productTagAlias || config.productTagAlias || '01';\r\n \r\n const response = await this.client.request<ProductTagResponse>(\r\n `/product-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取产品列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allProductIds.push(...targetCategory.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取产品列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递productTagAlias参数\r\n const tags = await this.getTags(options?.productTagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allProductIds.push(...targetTag.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: ProductCategory[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: ProductCategory, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: ProductCategory[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n\r\n /**\r\n * 8. 获取税费信息\r\n * 获取平台的所有税费模板和规则\r\n */\r\n async getTaxInfo(): Promise<TaxResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<TaxResponse>(`/tax/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 9. 获取运费信息\r\n * 获取平台的所有运费模板和规则\r\n */\r\n async getShippingInfo(): Promise<ShippingResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<ShippingResponse>(`/shipping/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 10. 获取区域信息\r\n * 获取平台的所有区域信息,包括层级结构\r\n */\r\n async getRegions(): Promise<RegionResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<RegionResponse>(`/regions/platform-${config.platformId}.json`);\r\n }\r\n} ","import { GT6Client } from './core/client';\r\nimport { ArticlesAPI } from './modules/articles';\r\nimport { ProductsAPI } from './modules/products';\r\nimport { \r\n GT6Config, \r\n ArticlesByCategoryOptions, \r\n ArticlesByTagOptions,\r\n ProductsByCategoryOptions,\r\n ProductsByTagOptions\r\n} from './core/types';\r\n\r\n/**\r\n * GT6 SDK 主类\r\n * 提供文章和产品管理相关的所有功能\r\n */\r\nexport class GT6SDK {\r\n public articles: ArticlesAPI;\r\n public products: ProductsAPI;\r\n\r\n constructor(config: GT6Config) {\r\n const client = new GT6Client(config);\r\n this.articles = new ArticlesAPI(client);\r\n this.products = new ProductsAPI(client);\r\n }\r\n\r\n /**\r\n * 获取客户端实例(用于高级用法)\r\n */\r\n getClient(): GT6Client {\r\n return (this.articles as any).client;\r\n }\r\n\r\n /**\r\n * 清除所有缓存\r\n */\r\n clearCache(): void {\r\n this.getClient().clearCache();\r\n }\r\n\r\n /**\r\n * 获取缓存统计信息\r\n */\r\n getCacheStats() {\r\n return this.getClient().getCacheStats();\r\n }\r\n\r\n /**\r\n * 1. 便捷方法:根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string) {\r\n return this.articles.getArticle(articleId);\r\n }\r\n\r\n /**\r\n * 2. 便捷方法:获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string) {\r\n return this.articles.getCategories(rootCategoryId);\r\n }\r\n\r\n /**\r\n * 3. 便捷方法:获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string) {\r\n return this.articles.getTags(tagAlias);\r\n }\r\n\r\n /**\r\n * 4. 便捷方法:根据分类ID获取文章列表\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions) {\r\n return this.articles.getArticlesByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 5. 便捷方法:根据标签ID获取文章列表\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions) {\r\n return this.articles.getArticlesByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 6. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getCategoryPath(categoryId: number) {\r\n return this.articles.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 7. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.articles.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 8. 便捷方法:根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string) {\r\n return this.products.getProduct(productId);\r\n }\r\n\r\n /**\r\n * 9. 便捷方法:获取产品分类列表\r\n */\r\n async getProductCategories(productRootCategoryId?: number | string) {\r\n return this.products.getCategories(productRootCategoryId);\r\n }\r\n\r\n /**\r\n * 10. 便捷方法:获取产品标签列表\r\n */\r\n async getProductTags(productTagAlias?: string) {\r\n return this.products.getTags(productTagAlias);\r\n }\r\n\r\n /**\r\n * 11. 便捷方法:根据分类ID获取产品列表\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions) {\r\n return this.products.getProductsByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 12. 便捷方法:根据标签ID获取产品列表\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions) {\r\n return this.products.getProductsByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 13. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getProductCategoryPath(categoryId: number) {\r\n return this.products.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 14. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getProductSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.products.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 15. 便捷方法:获取税费信息\r\n */\r\n async getTaxInfo() {\r\n return this.products.getTaxInfo();\r\n }\r\n\r\n /**\r\n * 16. 便捷方法:获取运费信息\r\n */\r\n async getShippingInfo() {\r\n return this.products.getShippingInfo();\r\n }\r\n\r\n /**\r\n * 17. 便捷方法:获取区域信息\r\n */\r\n async getRegions() {\r\n return this.products.getRegions();\r\n }\r\n}\r\n\r\n// 导出所有类型和模块\r\nexport * from './core/types';\r\nexport * from './core/client';\r\nexport * from './modules/articles';\r\nexport * from './modules/products';\r\n\r\n// 默认导出\r\nexport default GT6SDK; "],"names":[],"mappings":"AAycA;AACM,MAAO,QAAS,SAAQ,KAAK,CAAA;IACjC,WAAA,CACE,OAAe,EACR,UAAmB,EAAA;QAE1B,KAAK,CAAC,OAAO,CAAC;QAFP,IAAA,CAAA,UAAU,GAAV,UAAU;AAGjB,QAAA,IAAI,CAAC,IAAI,GAAG,UAAU;;AAEzB;;MChdY,SAAS,CAAA;AAIpB,IAAA,WAAA,CAAY,MAAiB,EAAA;QAC3B,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,KAAK,EAAE;AACL,gBAAA,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,MAAM;AACZ,aAAA;AACD,YAAA,GAAG;SACJ;AACD,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE;;AAGxB;;AAEG;AACH,IAAA,MAAM,OAAO,CAAI,QAAgB,EAAE,UAAuB,EAAE,EAAA;QAC1D,MAAM,GAAG,GAAG,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAE;QAC/C,MAAM,QAAQ,GAAG,CAAA,EAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;;QAGpD,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI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OAAmC,EAAA;QAC5F,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC;;AAGjE;;AAEG;AACH,IAAA,MAAM,gBAAgB,CAAC,KAAwB,EAAE,OAA8B,EAAA;QAC7E,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;;AAGvD;;AAEG;IACH,MAAM,sBAAsB,CAAC,UAAkB,EAAA;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC;;AAGlD;;AAEG;AACH,IAAA,MAAM,uBAAuB,CAAC,UAAkB,EAAE,OAIjD,EAAA;QACC,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC;;AAG5D;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGnC;;AAEG;AACH,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;;AAGxC;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAEpC;;;;"}
1
+ {"version":3,"file":"gt6-sdk.esm.js","sources":["../src/core/types.ts","../src/core/client.ts","../src/modules/articles.ts","../src/modules/products.ts","../src/index.ts"],"sourcesContent":["// 基础配置类型\nexport interface GT6Config {\n baseUrl: string;\n apiKey?: string;\n platformId: string | number;\n rootCategoryId?: string | number;\n tagAlias?: string;\n // 产品专用配置字段\n productRootCategoryId?: string | number;\n productTagAlias?: string;\n version?: string;\n timeout?: number;\n cache?: {\n enabled: boolean;\n ttl: number; // 缓存时间(毫秒)\n };\n}\n\n// 分类相关类型\nexport interface Category {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n articleIds: number[];\n children: Category[];\n}\n\nexport interface CategoryResponse {\n platformId: number;\n categories: Category[];\n generatedAt: string;\n}\n\n// 产品分类相关类型\nexport interface ProductCategory {\n categoryId: number;\n categoryName: string;\n categoryDescription: string;\n metaKeywords: string;\n status: number;\n parentId: number;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n productIds: number[];\n children: ProductCategory[];\n}\n\nexport interface ProductCategoryResponse {\n platformId: number;\n categories: ProductCategory[];\n generatedAt: string;\n}\n\n// 标签相关类型\nexport interface Tag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n articleIds: number[];\n}\n\nexport interface TagResponse {\n platformId: number;\n tags: Tag[];\n generatedAt: string;\n}\n\n// 产品标签相关类型\nexport interface ProductTag {\n tagId: number;\n tagName: string;\n type: number;\n platformId: number;\n aliases: string;\n createdAt: any;\n productIds: number[];\n}\n\nexport interface ProductTagResponse {\n platformId: number;\n tags: ProductTag[];\n generatedAt: string;\n}\n\n// 文章元数据类型\nexport interface ArticleMetaData {\n metaId: number;\n articleId: number;\n metaKey: string;\n metaValue: string;\n type: number;\n templateId: number;\n groupId: number;\n sortOrder: number;\n aiId: number;\n fieldId: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章图片类型\nexport interface ArticleImage {\n imageId: number;\n articleId: number;\n metaId: number | null;\n imageUrl: string;\n imageType: 'cover' | 'content';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 文章类型\nexport interface Article {\n articleId: number;\n title: string;\n content: string;\n status: 'published' | 'draft' | 'archived';\n publishedAt: string;\n templateId: number;\n aiId: number;\n platformId: number;\n isVisible: boolean;\n displayTemplate: string;\n createdAt: any;\n updatedAt: any;\n categories: Category[];\n tags: Tag[];\n metaData: ArticleMetaData[];\n images: ArticleImage[];\n generatedAt: string;\n}\n\n// 产品详情类型\nexport interface ProductDetail {\n detailId: number;\n productId: number;\n detailKey: string;\n detailValue: string;\n extraInfo: string;\n}\n\n// 产品选项值类型\nexport interface ProductOptionValue {\n valueId: number;\n optionId: number;\n value: string;\n description: string;\n priceAdjustment: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品选项类型\nexport interface ProductOption {\n optionId: number;\n productId: number;\n optionName: string;\n createdAt: any;\n updatedAt: any;\n values: ProductOptionValue[];\n}\n\n// 产品变体类型\nexport interface ProductVariant {\n variantId: number;\n productId: number;\n sku: string;\n price: string;\n stock: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 产品图片类型\nexport interface ProductImage {\n imageId: number;\n productId: number;\n productDetailId: number | null;\n optionValueId: number | null;\n imageUrl: string;\n imageType: 'gallery' | 'thumbnail' | 'detail';\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 地区类型\nexport interface Region {\n regionId: number;\n platformId: number;\n regionCode: string;\n regionName: string;\n regionLevel: string;\n parentId: number;\n children?: Region[];\n}\n\n// 运费规则类型\nexport interface ShippingRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n firstUnit: string;\n firstFee: string;\n additionalUnit: string;\n additionalFee: string;\n conditionType: string;\n conditionValue: string | null;\n createTime: any;\n updateTime: any;\n}\n\n// 运费模板类型\nexport interface ShippingTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultFee: string;\n freeShippingLimit: string;\n createTime: any;\n updateTime: any;\n rules: ShippingRule[];\n}\n\n// 运费响应类型\nexport interface ShippingResponse {\n platformId: number;\n templates: ShippingTemplate[];\n generatedAt: string;\n}\n\n// 税费规则类型\nexport interface TaxRule {\n ruleId: number;\n templateId: number;\n regionId: number;\n taxRate: string;\n createTime: any;\n updateTime: any;\n}\n\n// 税费模板类型\nexport interface TaxTemplate {\n templateId: number;\n platformId: number;\n templateName: string;\n defaultTaxRate: string;\n createTime: any;\n updateTime: any;\n rules: TaxRule[];\n}\n\n// 税费响应类型\nexport interface TaxResponse {\n platformId: number;\n templates: TaxTemplate[];\n generatedAt: string;\n}\n\n// 订阅类型\nexport interface Subscription {\n subscriptionId: number;\n productId: number;\n billingCycle: number;\n billingCycleUnit: string;\n billingCycleCount: number;\n setupFee: string;\n trialDays: number;\n trialPrice: string;\n renewalDiscount: string;\n autoRenew: boolean;\n allowCancel: boolean;\n cancelPolicy: string;\n refundPolicy: string;\n maxCycles: number;\n gracePeriod: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 批发类型\nexport interface Wholesale {\n wholesaleId: number;\n productId: number;\n minOrderQuantity: number;\n maxOrderQuantity: number;\n allowMixedVariants: boolean;\n showRetailPrice: boolean;\n wholesaleDescription: string;\n paymentTerms: string;\n shippingTerms: string;\n}\n\n// 价格层级类型\nexport interface PriceTier {\n tierId: number;\n wholesaleId: number;\n userLevel: number | null;\n minQuantity: number;\n maxQuantity: number;\n priceType: number;\n priceValue: string;\n sortOrder: number;\n}\n\n// 变体价格类型\nexport interface VariantPrice {\n id: number;\n wholesaleId: number;\n tierId: number;\n variantId: number;\n priceType: number;\n priceValue: string;\n}\n\n// 众筹类型\nexport interface Crowdfunding {\n crowdfundingId: number;\n productId: number;\n targetAmount: string;\n currentAmount: string;\n supporterCount: number;\n startTime: any;\n endTime: any;\n status: number;\n minSupportAmount: string;\n allowOverFunding: boolean;\n overFundingLimit: string;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹奖励类型\nexport interface Reward {\n rewardId: number;\n crowdfundingId: number;\n variantId: number;\n rewardName: string;\n rewardDescription: string;\n rewardAmount: string;\n rewardLimit: number;\n rewardClaimed: number;\n shippingRequired: boolean;\n estimatedDeliveryTime: any;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 众筹更新类型\nexport interface CrowdfundingUpdate {\n updateId: number;\n crowdfundingId: number;\n updateTitle: string;\n updateContent: string;\n isPublic: boolean;\n updateTime: any;\n}\n\n// 众筹FAQ类型\nexport interface CrowdfundingFAQ {\n faqId: number;\n crowdfundingId: number;\n question: string;\n answer: string;\n sortOrder: number;\n createdAt: any;\n updatedAt: any;\n}\n\n// 简单理财类型\nexport interface SimpleFinance {\n simpleFinanceId: number;\n productId: number;\n calculationPeriod: number;\n calculationPeriodUnit: string;\n interestRate: string;\n minInvestment: string;\n maxInvestment: string;\n minInvestmentUnit: string;\n maxInvestmentUnit: string;\n investmentPeriod: number;\n investmentPeriodUnit: string;\n}\n\n// 产品类型\nexport interface Product {\n productId: number;\n productName: string;\n description: string;\n metaKeywords: string;\n price: string;\n priceChangePercent: string;\n status: number;\n productType: number;\n native: number;\n shared: number;\n createdAt: any;\n updatedAt: any;\n platformId: number;\n oldProductId: number | null;\n details: ProductDetail[];\n options: ProductOption[];\n variants: ProductVariant[];\n images: ProductImage[];\n categories: ProductCategory[];\n tags: ProductTag[];\n regions: Region[];\n shippingTemplates: ShippingTemplate[];\n taxTemplates: TaxTemplate[];\n subscription?: Subscription; // 当productType为2时存在\n wholesale?: Wholesale; // 当productType为3时存在\n priceTiers?: PriceTier[]; // 当productType为3时存在\n variantPrices?: VariantPrice[]; // 当productType为3时存在\n crowdfunding?: Crowdfunding; // 当productType为4时存在\n rewards?: Reward[]; // 当productType为4时存在\n updates?: CrowdfundingUpdate[]; // 当productType为4时存在\n faqs?: CrowdfundingFAQ[]; // 当productType为4时存在\n simpleFinance?: SimpleFinance; // 当productType为5时存在\n generatedAt: string;\n}\n\n// 文章列表项类型(简化版)\nexport interface ArticleListItem {\n articleId: number;\n title: string;\n status: string;\n publishedAt: string;\n categories: Category[];\n tags: Tag[];\n coverImage?: string;\n}\n\n// 产品列表项类型(简化版)\nexport interface ProductListItem {\n productId: number;\n productName: string;\n price: string;\n status: number;\n categories: ProductCategory[];\n tags: ProductTag[];\n coverImage?: string;\n}\n\n// 错误类型\nexport class GT6Error extends Error {\n constructor(\n message: string,\n public statusCode?: number\n ) {\n super(message);\n this.name = 'GT6Error';\n }\n}\n\n// 查询参数类型\nexport interface ArticleQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: string;\n limit?: number;\n offset?: number;\n sortBy?: 'publishedAt' | 'title' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 产品查询参数类型\nexport interface ProductQueryParams {\n categoryId?: number;\n tagId?: number;\n status?: number;\n limit?: number;\n offset?: number;\n sortBy?: 'price' | 'productName' | 'sortOrder';\n sortOrder?: 'asc' | 'desc';\n}\n\n// 根据标签获取文章的选项类型\nexport interface ArticlesByTagOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n tagAlias?: string;\n}\n\n// 根据分类获取文章的选项类型\nexport interface ArticlesByCategoryOptions {\n page?: number;\n limit?: number;\n status?: 'published' | 'draft' | 'archived';\n}\n\n// 根据标签获取产品的选项类型\nexport interface ProductsByTagOptions {\n page?: number;\n limit?: number;\n status?: number;\n productTagAlias?: string;\n}\n\n// 根据分类获取产品的选项类型\nexport interface ProductsByCategoryOptions {\n page?: number;\n limit?: number;\n status?: number;\n}\n\n// 文章统计类型\nexport interface ArticleStats {\n total: number;\n published: number;\n draft: number;\n archived: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\n// 产品统计类型\nexport interface ProductStats {\n total: number;\n active: number;\n inactive: number;\n byCategory: Record<number, number>;\n byTag: Record<number, number>;\n}\n\nexport interface GT6Response<T> {\n success: boolean;\n data: T;\n error?: string;\n}\n\nexport interface ArticleResponse {\n article: Article;\n}\n\nexport interface ProductResponse {\n product: Product;\n}\n\nexport interface CategoryResponse {\n categories: Category[];\n}\n\nexport interface ProductCategoryResponse {\n categories: ProductCategory[];\n}\n\nexport interface TagResponse {\n tags: Tag[];\n}\n\nexport interface ProductTagResponse {\n tags: ProductTag[];\n}\n\n// 区域响应类型\nexport interface RegionResponse {\n platformId: number;\n regions: Region[];\n generatedAt: string;\n} ","import { GT6Config, GT6Error } from './types';\r\n\r\nexport class GT6Client {\r\n private config: GT6Config;\r\n private cache: Map<string, { data: any; timestamp: number }>;\r\n\r\n constructor(config: GT6Config) {\r\n this.config = {\r\n timeout: 10000,\r\n cache: {\r\n enabled: true,\r\n ttl: 300000 // 5分钟默认缓存\r\n },\r\n ...config\r\n };\r\n this.cache = new Map();\r\n }\r\n\r\n /**\r\n * 发起HTTP请求\r\n */\r\n async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {\r\n const url = `${this.config.baseUrl}${endpoint}`;\r\n const cacheKey = `${options.method || 'GET'}:${url}`;\r\n\r\n // 检查缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n const cached = this.cache.get(cacheKey);\r\n if (cached && Date.now() - cached.timestamp < this.config.cache.ttl) {\r\n return cached.data;\r\n }\r\n }\r\n\r\n try {\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\r\n\r\n const response = await fetch(url, {\r\n ...options,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...options.headers,\r\n },\r\n signal: controller.signal\r\n });\r\n\r\n clearTimeout(timeoutId);\r\n\r\n if (!response.ok) {\r\n throw new GT6Error(\r\n `HTTP ${response.status}: ${response.statusText}`,\r\n response.status\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n\r\n // 更新缓存(只对GET请求缓存)\r\n if (this.config.cache?.enabled && options.method !== 'POST' && options.method !== 'PUT' && options.method !== 'DELETE') {\r\n this.cache.set(cacheKey, { data, timestamp: Date.now() });\r\n }\r\n\r\n return data;\r\n } catch (error: any) {\r\n if (error instanceof GT6Error) {\r\n throw error;\r\n }\r\n \r\n if (error.name === 'AbortError') {\r\n throw new GT6Error('Request timeout', 408);\r\n }\r\n \r\n throw new GT6Error(`Network error: ${error.message}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取配置\r\n */\r\n getConfig(): GT6Config {\r\n return { ...this.config };\r\n }\r\n\r\n /**\r\n * 清除缓存\r\n */\r\n clearCache(): void {\r\n this.cache.clear();\r\n }\r\n\r\n /**\r\n * 获取缓存统计\r\n */\r\n getCacheStats(): { size: number; entries: Array<{ key: string; age: number }> } {\r\n const entries = Array.from(this.cache.entries()).map(([key, value]) => ({\r\n key,\r\n age: Date.now() - value.timestamp\r\n }));\r\n\r\n return {\r\n size: this.cache.size,\r\n entries\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Article,\r\n Category,\r\n Tag,\r\n CategoryResponse,\r\n TagResponse,\r\n ArticlesByTagOptions,\r\n ArticlesByCategoryOptions\r\n} from '../core/types';\r\n\r\nexport class ArticlesAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string): Promise<Article> {\r\n return this.client.request<Article>(`/articles/${articleId}.json`);\r\n }\r\n\r\n /**\r\n * 2. 获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string): Promise<Category[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = rootCategoryId || config.rootCategoryId || '671920';\r\n \r\n const response = await this.client.request<CategoryResponse>(\r\n `/article-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string): Promise<Tag[]> {\r\n const config = this.client.getConfig();\r\n const alias = tagAlias || config.tagAlias || '001';\r\n \r\n const response = await this.client.request<TagResponse>(\r\n `/article-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取文章列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = categories.find(cat => cat.categoryId === id);\r\n if (targetCategory) {\r\n allArticleIds.push(...targetCategory.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取文章列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions): Promise<{\r\n articles: Article[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递tagAlias参数\r\n const tags = await this.getTags(options?.tagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的文章ID\r\n const allArticleIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allArticleIds.push(...targetTag.articleIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueArticleIds = [...new Set(allArticleIds)];\r\n \r\n if (uniqueArticleIds.length === 0) {\r\n return {\r\n articles: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);\r\n \r\n // 获取文章详情\r\n const articles = await Promise.all(\r\n paginatedArticleIds.map(articleId => this.getArticle(articleId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredArticles = articles;\r\n if (options?.status) {\r\n filteredArticles = articles.filter(article => article.status === options.status);\r\n }\r\n \r\n return {\r\n articles: filteredArticles,\r\n total: uniqueArticleIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: Category[];\r\n currentCategory: Category | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: Category[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类\r\n const buildPath = (currentCategory: Category, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = categories.find(cat => cat.categoryId === currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: Category[];\r\n currentCategory: Category | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 查找目标分类\r\n const targetCategory = categories.find(cat => cat.categoryId === categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: Category[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 查找直接子分类\r\n const children = categories.filter(cat => cat.parentId === parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n} ","import { GT6Client } from '../core/client';\r\nimport {\r\n Product,\r\n ProductCategory,\r\n ProductTag,\r\n ProductCategoryResponse,\r\n ProductTagResponse,\r\n ProductsByTagOptions,\r\n ProductsByCategoryOptions,\r\n TaxResponse,\r\n ShippingResponse,\r\n RegionResponse\r\n} from '../core/types';\r\n\r\nexport class ProductsAPI {\r\n constructor(private client: GT6Client) {}\r\n\r\n /**\r\n * 1. 根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string): Promise<Product> {\r\n const product = await this.client.request<Product>(`/products/${productId}.json`);\r\n \r\n // 检查产品是否有销售区域和税费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.taxTemplates && product.taxTemplates.length > 0) {\r\n try {\r\n // 获取税费信息\r\n const taxInfo = await this.getTaxInfo();\r\n \r\n // 为每个税费模板添加规则\r\n product.taxTemplates = product.taxTemplates.map(template => {\r\n const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取税费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch tax info:', error);\r\n }\r\n }\r\n \r\n // 检查产品是否有销售区域和运费模板\r\n if (product.regions && product.regions.length > 0 && \r\n product.shippingTemplates && product.shippingTemplates.length > 0) {\r\n try {\r\n // 获取运费信息\r\n const shippingInfo = await this.getShippingInfo();\r\n \r\n // 为每个运费模板添加规则\r\n product.shippingTemplates = product.shippingTemplates.map(template => {\r\n const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);\r\n if (matchingTemplate) {\r\n // 过滤出产品可销售区域的规则\r\n const productRegionIds = product.regions.map(r => r.regionId);\r\n const applicableRules = matchingTemplate.rules.filter(rule => \r\n productRegionIds.includes(rule.regionId)\r\n );\r\n \r\n return {\r\n ...template,\r\n rules: applicableRules\r\n };\r\n }\r\n return template;\r\n });\r\n } catch (error) {\r\n // 如果获取运费信息失败,不影响产品详情返回\r\n console.warn('Failed to fetch shipping info:', error);\r\n }\r\n }\r\n \r\n return product;\r\n }\r\n\r\n /**\r\n * 2. 获取产品分类列表\r\n */\r\n async getCategories(productRootCategoryId?: number | string): Promise<ProductCategory[]> {\r\n const config = this.client.getConfig();\r\n const categoryId = productRootCategoryId || config.productRootCategoryId || '277233';\r\n \r\n const response = await this.client.request<ProductCategoryResponse>(\r\n `/product-categories/platform-${config.platformId}-root-${categoryId}.json`\r\n );\r\n \r\n return response.categories;\r\n }\r\n\r\n /**\r\n * 3. 获取产品标签列表\r\n */\r\n async getTags(productTagAlias?: string): Promise<ProductTag[]> {\r\n const config = this.client.getConfig();\r\n const alias = productTagAlias || config.productTagAlias || '01';\r\n \r\n const response = await this.client.request<ProductTagResponse>(\r\n `/product-tags/platform-${config.platformId}-${alias}.json`\r\n );\r\n \r\n return response.tags;\r\n }\r\n\r\n /**\r\n * 4. 根据分类ID获取产品列表\r\n * 支持单个分类ID或分类ID数组\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 将单个分类ID转换为数组\r\n const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];\r\n \r\n // 收集所有指定分类下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n categoryIds.forEach(id => {\r\n const targetCategory = findCategoryById(categories, id);\r\n if (targetCategory) {\r\n allProductIds.push(...targetCategory.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 5. 根据标签ID获取产品列表\r\n * 支持单个标签ID或标签ID数组\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions): Promise<{\r\n products: Product[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n }> {\r\n // 获取标签数据,传递productTagAlias参数\r\n const tags = await this.getTags(options?.productTagAlias);\r\n \r\n // 将单个标签ID转换为数组\r\n const tagIds = Array.isArray(tagId) ? tagId : [tagId];\r\n \r\n // 收集所有指定标签下的产品ID\r\n const allProductIds: number[] = [];\r\n \r\n tagIds.forEach(id => {\r\n const targetTag = tags.find(tag => tag.tagId === id);\r\n if (targetTag) {\r\n allProductIds.push(...targetTag.productIds);\r\n }\r\n });\r\n \r\n // 去重\r\n const uniqueProductIds = [...new Set(allProductIds)];\r\n \r\n if (uniqueProductIds.length === 0) {\r\n return {\r\n products: [],\r\n total: 0,\r\n page: options?.page || 1,\r\n limit: options?.limit || 10\r\n };\r\n }\r\n \r\n // 应用分页\r\n const page = options?.page || 1;\r\n const limit = options?.limit || 10;\r\n const offset = (page - 1) * limit;\r\n const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);\r\n \r\n // 获取产品详情\r\n const products = await Promise.all(\r\n paginatedProductIds.map(productId => this.getProduct(productId))\r\n );\r\n \r\n // 应用状态过滤\r\n let filteredProducts = products;\r\n if (options?.status !== undefined) {\r\n filteredProducts = products.filter(product => product.status === options.status);\r\n }\r\n \r\n return {\r\n products: filteredProducts,\r\n total: uniqueProductIds.length,\r\n page,\r\n limit\r\n };\r\n }\r\n\r\n /**\r\n * 6. 根据分类ID获取该分类的层级路径\r\n * 用于前端面包屑导航\r\n */\r\n async getCategoryPath(categoryId: number): Promise<{\r\n path: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }>;\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找目标分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 查找目标分类(包括子分类)\r\n const targetCategory = findCategoryById(categories, categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n path: [],\r\n currentCategory: null,\r\n breadcrumbs: []\r\n };\r\n }\r\n \r\n // 构建分类路径\r\n const path: ProductCategory[] = [];\r\n const breadcrumbs: Array<{\r\n categoryId: number;\r\n categoryName: string;\r\n level: number;\r\n }> = [];\r\n \r\n // 递归查找父分类的函数\r\n const buildPath = (currentCategory: ProductCategory, level: number = 0): void => {\r\n // 将当前分类添加到路径开头(因为我们要从根到叶子构建)\r\n path.unshift(currentCategory);\r\n breadcrumbs.unshift({\r\n categoryId: currentCategory.categoryId,\r\n categoryName: currentCategory.categoryName,\r\n level\r\n });\r\n \r\n // 如果有父分类,继续递归\r\n if (currentCategory.parentId && currentCategory.parentId !== 0) {\r\n const parentCategory = findCategoryById(categories, currentCategory.parentId);\r\n if (parentCategory) {\r\n buildPath(parentCategory, level + 1);\r\n }\r\n }\r\n };\r\n \r\n // 从目标分类开始构建路径\r\n buildPath(targetCategory);\r\n \r\n return {\r\n path,\r\n currentCategory: targetCategory,\r\n breadcrumbs\r\n };\r\n }\r\n\r\n /**\r\n * 7. 获取指定分类ID下的子分类\r\n * 支持递归获取所有层级的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean; // 是否递归获取所有层级的子分类\r\n includeCurrent?: boolean; // 是否包含当前分类\r\n maxDepth?: number; // 最大递归深度,默认不限制\r\n }): Promise<{\r\n subCategories: ProductCategory[];\r\n currentCategory: ProductCategory | null;\r\n total: number;\r\n depth: number; // 实际递归深度\r\n }> {\r\n // 获取所有分类数据\r\n const categories = await this.getCategories();\r\n \r\n // 递归查找分类的函数\r\n const findCategoryById = (cats: ProductCategory[], targetId: number): ProductCategory | null => {\r\n for (const cat of cats) {\r\n if (cat.categoryId === targetId) {\r\n return cat;\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n const found = findCategoryById(cat.children, targetId);\r\n if (found) return found;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n // 查找目标分类(包括子分类)\r\n const targetCategory = findCategoryById(categories, categoryId);\r\n \r\n if (!targetCategory) {\r\n return {\r\n subCategories: [],\r\n currentCategory: null,\r\n total: 0,\r\n depth: 0\r\n };\r\n }\r\n \r\n const subCategories: ProductCategory[] = [];\r\n let maxDepth = options?.maxDepth || Infinity;\r\n let actualDepth = 0;\r\n \r\n // 递归获取子分类的函数\r\n const collectSubCategories = (parentId: number, currentDepth: number = 0): void => {\r\n if (currentDepth >= maxDepth) {\r\n return;\r\n }\r\n \r\n // 递归查找直接子分类\r\n const findChildren = (cats: ProductCategory[], parentId: number): ProductCategory[] => {\r\n const children: ProductCategory[] = [];\r\n for (const cat of cats) {\r\n if (cat.parentId === parentId) {\r\n children.push(cat);\r\n }\r\n if (cat.children && cat.children.length > 0) {\r\n children.push(...findChildren(cat.children, parentId));\r\n }\r\n }\r\n return children;\r\n };\r\n \r\n const children = findChildren(categories, parentId);\r\n \r\n children.forEach(child => {\r\n subCategories.push(child);\r\n \r\n // 如果需要递归且未达到最大深度,继续查找子分类\r\n if (options?.recursive && currentDepth < maxDepth - 1) {\r\n collectSubCategories(child.categoryId, currentDepth + 1);\r\n }\r\n });\r\n \r\n // 更新实际深度\r\n actualDepth = Math.max(actualDepth, currentDepth);\r\n };\r\n \r\n // 开始收集子分类\r\n collectSubCategories(categoryId);\r\n \r\n // 如果需要包含当前分类,添加到结果中\r\n if (options?.includeCurrent) {\r\n subCategories.unshift(targetCategory);\r\n }\r\n \r\n return {\r\n subCategories,\r\n currentCategory: targetCategory,\r\n total: subCategories.length,\r\n depth: actualDepth\r\n };\r\n }\r\n\r\n /**\r\n * 8. 获取税费信息\r\n * 获取平台的所有税费模板和规则\r\n */\r\n async getTaxInfo(): Promise<TaxResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<TaxResponse>(`/tax/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 9. 获取运费信息\r\n * 获取平台的所有运费模板和规则\r\n */\r\n async getShippingInfo(): Promise<ShippingResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<ShippingResponse>(`/shipping/platform-${config.platformId}.json`);\r\n }\r\n\r\n /**\r\n * 10. 获取区域信息\r\n * 获取平台的所有区域信息,包括层级结构\r\n */\r\n async getRegions(): Promise<RegionResponse> {\r\n const config = this.client.getConfig();\r\n return this.client.request<RegionResponse>(`/regions/platform-${config.platformId}.json`);\r\n }\r\n} ","import { GT6Client } from './core/client';\r\nimport { ArticlesAPI } from './modules/articles';\r\nimport { ProductsAPI } from './modules/products';\r\nimport { \r\n GT6Config, \r\n ArticlesByCategoryOptions, \r\n ArticlesByTagOptions,\r\n ProductsByCategoryOptions,\r\n ProductsByTagOptions\r\n} from './core/types';\r\n\r\n/**\r\n * GT6 SDK 主类\r\n * 提供文章和产品管理相关的所有功能\r\n */\r\nexport class GT6SDK {\r\n public articles: ArticlesAPI;\r\n public products: ProductsAPI;\r\n\r\n constructor(config: GT6Config) {\r\n const client = new GT6Client(config);\r\n this.articles = new ArticlesAPI(client);\r\n this.products = new ProductsAPI(client);\r\n }\r\n\r\n /**\r\n * 获取客户端实例(用于高级用法)\r\n */\r\n getClient(): GT6Client {\r\n return (this.articles as any).client;\r\n }\r\n\r\n /**\r\n * 清除所有缓存\r\n */\r\n clearCache(): void {\r\n this.getClient().clearCache();\r\n }\r\n\r\n /**\r\n * 获取缓存统计信息\r\n */\r\n getCacheStats() {\r\n return this.getClient().getCacheStats();\r\n }\r\n\r\n /**\r\n * 1. 便捷方法:根据文章ID获取文章详情\r\n */\r\n async getArticle(articleId: number | string) {\r\n return this.articles.getArticle(articleId);\r\n }\r\n\r\n /**\r\n * 2. 便捷方法:获取文章分类列表\r\n */\r\n async getCategories(rootCategoryId?: number | string) {\r\n return this.articles.getCategories(rootCategoryId);\r\n }\r\n\r\n /**\r\n * 3. 便捷方法:获取文章标签列表\r\n */\r\n async getTags(tagAlias?: string) {\r\n return this.articles.getTags(tagAlias);\r\n }\r\n\r\n /**\r\n * 4. 便捷方法:根据分类ID获取文章列表\r\n */\r\n async getArticlesByCategory(categoryId: number | number[], options?: ArticlesByCategoryOptions) {\r\n return this.articles.getArticlesByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 5. 便捷方法:根据标签ID获取文章列表\r\n */\r\n async getArticlesByTag(tagId: number | number[], options?: ArticlesByTagOptions) {\r\n return this.articles.getArticlesByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 6. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getCategoryPath(categoryId: number) {\r\n return this.articles.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 7. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.articles.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 8. 便捷方法:根据产品ID获取产品详情\r\n */\r\n async getProduct(productId: number | string) {\r\n return this.products.getProduct(productId);\r\n }\r\n\r\n /**\r\n * 9. 便捷方法:获取产品分类列表\r\n */\r\n async getProductCategories(productRootCategoryId?: number | string) {\r\n return this.products.getCategories(productRootCategoryId);\r\n }\r\n\r\n /**\r\n * 10. 便捷方法:获取产品标签列表\r\n */\r\n async getProductTags(productTagAlias?: string) {\r\n return this.products.getTags(productTagAlias);\r\n }\r\n\r\n /**\r\n * 11. 便捷方法:根据分类ID获取产品列表\r\n */\r\n async getProductsByCategory(categoryId: number | number[], options?: ProductsByCategoryOptions) {\r\n return this.products.getProductsByCategory(categoryId, options);\r\n }\r\n\r\n /**\r\n * 12. 便捷方法:根据标签ID获取产品列表\r\n */\r\n async getProductsByTag(tagId: number | number[], options?: ProductsByTagOptions) {\r\n return this.products.getProductsByTag(tagId, options);\r\n }\r\n\r\n /**\r\n * 13. 便捷方法:根据分类ID获取该分类的层级路径\r\n */\r\n async getProductCategoryPath(categoryId: number) {\r\n return this.products.getCategoryPath(categoryId);\r\n }\r\n\r\n /**\r\n * 14. 便捷方法:获取指定分类ID下的子分类\r\n */\r\n async getProductSubCategories(categoryId: number, options?: {\r\n recursive?: boolean;\r\n includeCurrent?: boolean;\r\n maxDepth?: number;\r\n }) {\r\n return this.products.getSubCategories(categoryId, options);\r\n }\r\n\r\n /**\r\n * 15. 便捷方法:获取税费信息\r\n */\r\n async getTaxInfo() {\r\n return this.products.getTaxInfo();\r\n }\r\n\r\n /**\r\n * 16. 便捷方法:获取运费信息\r\n */\r\n async getShippingInfo() {\r\n return this.products.getShippingInfo();\r\n }\r\n\r\n /**\r\n * 17. 便捷方法:获取区域信息\r\n */\r\n async getRegions() {\r\n return this.products.getRegions();\r\n }\r\n}\r\n\r\n// 导出所有类型和模块\r\nexport * from './core/types';\r\nexport * from './core/client';\r\nexport * from './modules/articles';\r\nexport * from './modules/products';\r\n\r\n// 默认导出\r\nexport default GT6SDK; "],"names":[],"mappings":"AAycA;AACM,MAAO,QAAS,SAAQ,KAAK,CAAA;IACjC,WAAA,CACE,OAAe,EACR,UAAmB,EAAA;QAE1B,KAAK,CAAC,OAAO,CAAC;QAFP,IAAA,CAAA,UAAU,GAAV,UAAU;AAGjB,QAAA,IAAI,CAAC,IAAI,GAAG,UAAU;;AAEzB;;MChdY,SAAS,CAAA;AAIpB,IAAA,WAAA,CAAY,MAAiB,EAAA;QAC3B,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,KAAK,EAAE;AACL,gBAAA,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,MAAM;AACZ,aAAA;AACD,YAAA,GAAG;SACJ;AACD,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE;;AAGxB;;AAEG;AACH,IAAA,MAAM,OAAO,CAAI,QAAgB,EAAE,UAAuB,EAAE,EAAA;QAC1D,MAAM,GAAG,GAAG,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAE;QAC/C,MAAM,QAAQ,GAAG,CAAA,EAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;;QAGpD,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE;YACtH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvC,YAAA,IAA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IAAI,OAAO,CAAC,WAAW,CAAC;IAKxC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKlD;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC;CAI5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gt6/sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "GT6 SDK for articles management - A comprehensive JavaScript/TypeScript library for managing articles, categories, and tags in GT6 platform",
5
5
  "type": "module",
6
6
  "main": "dist/gt6-sdk.cjs.js",