@dani-builder/strapi-client 0.1.0

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.
Files changed (153) hide show
  1. package/dist/api/articles.d.ts +29 -0
  2. package/dist/api/articles.d.ts.map +1 -0
  3. package/dist/api/articles.js +54 -0
  4. package/dist/api/articles.js.map +1 -0
  5. package/dist/api/authors.d.ts +15 -0
  6. package/dist/api/authors.d.ts.map +1 -0
  7. package/dist/api/authors.js +27 -0
  8. package/dist/api/authors.js.map +1 -0
  9. package/dist/api/categories.d.ts +12 -0
  10. package/dist/api/categories.d.ts.map +1 -0
  11. package/dist/api/categories.js +14 -0
  12. package/dist/api/categories.js.map +1 -0
  13. package/dist/api/faqs.d.ts +13 -0
  14. package/dist/api/faqs.d.ts.map +1 -0
  15. package/dist/api/faqs.js +20 -0
  16. package/dist/api/faqs.js.map +1 -0
  17. package/dist/api/global.d.ts +15 -0
  18. package/dist/api/global.d.ts.map +1 -0
  19. package/dist/api/global.js +25 -0
  20. package/dist/api/global.js.map +1 -0
  21. package/dist/api/index.d.ts +21 -0
  22. package/dist/api/index.d.ts.map +1 -0
  23. package/dist/api/index.js +12 -0
  24. package/dist/api/index.js.map +1 -0
  25. package/dist/api/inquiry.d.ts +7 -0
  26. package/dist/api/inquiry.d.ts.map +1 -0
  27. package/dist/api/inquiry.js +9 -0
  28. package/dist/api/inquiry.js.map +1 -0
  29. package/dist/api/navigation.d.ts +10 -0
  30. package/dist/api/navigation.d.ts.map +1 -0
  31. package/dist/api/navigation.js +15 -0
  32. package/dist/api/navigation.js.map +1 -0
  33. package/dist/api/pages.d.ts +30 -0
  34. package/dist/api/pages.d.ts.map +1 -0
  35. package/dist/api/pages.js +53 -0
  36. package/dist/api/pages.js.map +1 -0
  37. package/dist/api/series.d.ts +16 -0
  38. package/dist/api/series.d.ts.map +1 -0
  39. package/dist/api/series.js +29 -0
  40. package/dist/api/series.js.map +1 -0
  41. package/dist/api/site-settings.d.ts +7 -0
  42. package/dist/api/site-settings.d.ts.map +1 -0
  43. package/dist/api/site-settings.js +14 -0
  44. package/dist/api/site-settings.js.map +1 -0
  45. package/dist/api/tags.d.ts +12 -0
  46. package/dist/api/tags.d.ts.map +1 -0
  47. package/dist/api/tags.js +14 -0
  48. package/dist/api/tags.js.map +1 -0
  49. package/dist/client/create-client.d.ts +25 -0
  50. package/dist/client/create-client.d.ts.map +1 -0
  51. package/dist/client/create-client.js +31 -0
  52. package/dist/client/create-client.js.map +1 -0
  53. package/dist/client/index.d.ts +3 -0
  54. package/dist/client/index.d.ts.map +1 -0
  55. package/dist/client/index.js +2 -0
  56. package/dist/client/index.js.map +1 -0
  57. package/dist/index.d.ts +8 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +10 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/populate/builders.d.ts +125 -0
  62. package/dist/populate/builders.d.ts.map +1 -0
  63. package/dist/populate/builders.js +139 -0
  64. package/dist/populate/builders.js.map +1 -0
  65. package/dist/populate/core-blocks.d.ts +25 -0
  66. package/dist/populate/core-blocks.d.ts.map +1 -0
  67. package/dist/populate/core-blocks.js +167 -0
  68. package/dist/populate/core-blocks.js.map +1 -0
  69. package/dist/populate/index.d.ts +3 -0
  70. package/dist/populate/index.d.ts.map +1 -0
  71. package/dist/populate/index.js +3 -0
  72. package/dist/populate/index.js.map +1 -0
  73. package/dist/types/components/blocks.d.ts +94 -0
  74. package/dist/types/components/blocks.d.ts.map +1 -0
  75. package/dist/types/components/blocks.js +4 -0
  76. package/dist/types/components/blocks.js.map +1 -0
  77. package/dist/types/components/elements.d.ts +21 -0
  78. package/dist/types/components/elements.d.ts.map +1 -0
  79. package/dist/types/components/elements.js +4 -0
  80. package/dist/types/components/elements.js.map +1 -0
  81. package/dist/types/components/index.d.ts +4 -0
  82. package/dist/types/components/index.d.ts.map +1 -0
  83. package/dist/types/components/index.js +2 -0
  84. package/dist/types/components/index.js.map +1 -0
  85. package/dist/types/components/shared.d.ts +116 -0
  86. package/dist/types/components/shared.d.ts.map +1 -0
  87. package/dist/types/components/shared.js +4 -0
  88. package/dist/types/components/shared.js.map +1 -0
  89. package/dist/types/content-types/article.d.ts +26 -0
  90. package/dist/types/content-types/article.d.ts.map +1 -0
  91. package/dist/types/content-types/article.js +4 -0
  92. package/dist/types/content-types/article.js.map +1 -0
  93. package/dist/types/content-types/author.d.ts +12 -0
  94. package/dist/types/content-types/author.d.ts.map +1 -0
  95. package/dist/types/content-types/author.js +4 -0
  96. package/dist/types/content-types/author.js.map +1 -0
  97. package/dist/types/content-types/category.d.ts +9 -0
  98. package/dist/types/content-types/category.d.ts.map +1 -0
  99. package/dist/types/content-types/category.js +4 -0
  100. package/dist/types/content-types/category.js.map +1 -0
  101. package/dist/types/content-types/faq.d.ts +10 -0
  102. package/dist/types/content-types/faq.d.ts.map +1 -0
  103. package/dist/types/content-types/faq.js +4 -0
  104. package/dist/types/content-types/faq.js.map +1 -0
  105. package/dist/types/content-types/global.d.ts +19 -0
  106. package/dist/types/content-types/global.d.ts.map +1 -0
  107. package/dist/types/content-types/global.js +4 -0
  108. package/dist/types/content-types/global.js.map +1 -0
  109. package/dist/types/content-types/index.d.ts +12 -0
  110. package/dist/types/content-types/index.d.ts.map +1 -0
  111. package/dist/types/content-types/index.js +2 -0
  112. package/dist/types/content-types/index.js.map +1 -0
  113. package/dist/types/content-types/inquiry.d.ts +18 -0
  114. package/dist/types/content-types/inquiry.d.ts.map +1 -0
  115. package/dist/types/content-types/inquiry.js +4 -0
  116. package/dist/types/content-types/inquiry.js.map +1 -0
  117. package/dist/types/content-types/navigation.d.ts +12 -0
  118. package/dist/types/content-types/navigation.d.ts.map +1 -0
  119. package/dist/types/content-types/navigation.js +4 -0
  120. package/dist/types/content-types/navigation.js.map +1 -0
  121. package/dist/types/content-types/page.d.ts +15 -0
  122. package/dist/types/content-types/page.d.ts.map +1 -0
  123. package/dist/types/content-types/page.js +4 -0
  124. package/dist/types/content-types/page.js.map +1 -0
  125. package/dist/types/content-types/series.d.ts +9 -0
  126. package/dist/types/content-types/series.d.ts.map +1 -0
  127. package/dist/types/content-types/series.js +4 -0
  128. package/dist/types/content-types/series.js.map +1 -0
  129. package/dist/types/content-types/site-settings.d.ts +10 -0
  130. package/dist/types/content-types/site-settings.d.ts.map +1 -0
  131. package/dist/types/content-types/site-settings.js +4 -0
  132. package/dist/types/content-types/site-settings.js.map +1 -0
  133. package/dist/types/content-types/tag.d.ts +10 -0
  134. package/dist/types/content-types/tag.d.ts.map +1 -0
  135. package/dist/types/content-types/tag.js +4 -0
  136. package/dist/types/content-types/tag.js.map +1 -0
  137. package/dist/types/index.d.ts +4 -0
  138. package/dist/types/index.d.ts.map +1 -0
  139. package/dist/types/index.js +2 -0
  140. package/dist/types/index.js.map +1 -0
  141. package/dist/types/strapi.d.ts +126 -0
  142. package/dist/types/strapi.d.ts.map +1 -0
  143. package/dist/types/strapi.js +4 -0
  144. package/dist/types/strapi.js.map +1 -0
  145. package/dist/utils/index.d.ts +2 -0
  146. package/dist/utils/index.d.ts.map +1 -0
  147. package/dist/utils/index.js +2 -0
  148. package/dist/utils/index.js.map +1 -0
  149. package/dist/utils/media.d.ts +12 -0
  150. package/dist/utils/media.d.ts.map +1 -0
  151. package/dist/utils/media.js +25 -0
  152. package/dist/utils/media.js.map +1 -0
  153. package/package.json +56 -0
@@ -0,0 +1,4 @@
1
+ // Site Settings single type (draftAndPublish: false)
2
+ // Source: packages/strapi-plugin-builder/schemas/api/site-setting/content-types/site-setting/schema.json
3
+ export {};
4
+ //# sourceMappingURL=site-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-settings.js","sourceRoot":"","sources":["../../../src/types/content-types/site-settings.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,yGAAyG"}
@@ -0,0 +1,10 @@
1
+ import type { StrapiI18nDocument } from '../strapi.js';
2
+ export interface Tag {
3
+ name: string;
4
+ slug: string;
5
+ /** Custom field: plugin::color-picker.color — hex color string */
6
+ color: string | null;
7
+ description: string | null;
8
+ }
9
+ export type TagDocument = StrapiI18nDocument & Tag;
10
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/types/content-types/tag.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,GAAG,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Tag content type (draftAndPublish: false)
2
+ // Source: packages/strapi-plugin-builder/schemas/api/tag/content-types/tag/schema.json
3
+ export {};
4
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../src/types/content-types/tag.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF"}
@@ -0,0 +1,4 @@
1
+ export type { StrapiDocument, StrapiI18nDocument, StrapiComponent, StrapiResponse, StrapiCollectionResponse, StrapiPagination, StrapiError, StrapiMedia, StrapiMediaFormat, BlocksContent, BlockNode, BlockParagraph, BlockHeading, BlockList, BlockListItem, BlockQuote, BlockCode, BlockImage, BlockInlineNode, BlockTextChild, BlockLinkChild, } from './strapi.js';
2
+ export type { Link, NavigationGroup, Seo, FeatureItem, HighlightItem, SliderItem, BentoItem, TestimonialItem, LogoItem, StatItem, PricingTier, TeamMember, AnalyticsSetting, ChatbotSetting, SiteVerification, BrandColors, Section, Footer, HeroBlock, FeaturesBlock, CtaBlock, SliderBlock, InquiryFormBlock, FaqBlock, HighlightsBlock, BentoGridBlock, TestimonialsBlock, LogoCloudBlock, StatsBlock, PricingBlock, ContentBlock, TeamBlock, } from './components/index.js';
3
+ export type { Page, PageDocument, PageBlocks, Article, ArticleDocument, Faq, FaqDocument, Inquiry, InquiryDocument, InquiryFormData, Category, CategoryDocument, Tag, TagDocument, Author, AuthorDocument, Series, SeriesDocument, Navigation, NavigationDocument, Global, GlobalDocument, SiteWideBlocks, SiteSettings, SiteSettingsDocument, } from './content-types/index.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,IAAI,EACJ,eAAe,EACf,GAAG,EACH,WAAW,EACX,aAAa,EACb,UAAU,EACV,SAAS,EACT,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,MAAM,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,OAAO,EACP,eAAe,EACf,GAAG,EACH,WAAW,EACX,OAAO,EACP,eAAe,EACf,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,GAAG,EACH,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,EACN,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,cAAc,EACd,YAAY,EACZ,oBAAoB,GACrB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,126 @@
1
+ export interface StrapiDocument {
2
+ id: number;
3
+ documentId: string;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ publishedAt: string | null;
7
+ }
8
+ export interface StrapiI18nDocument extends StrapiDocument {
9
+ locale: string;
10
+ }
11
+ export interface StrapiComponent<Name extends string = string> {
12
+ id: number;
13
+ __component: Name;
14
+ }
15
+ export interface StrapiResponse<T> {
16
+ data: T;
17
+ meta: Record<string, unknown>;
18
+ }
19
+ export interface StrapiCollectionResponse<T> {
20
+ data: T[];
21
+ meta: {
22
+ pagination: StrapiPagination;
23
+ };
24
+ }
25
+ export interface StrapiPagination {
26
+ page: number;
27
+ pageSize: number;
28
+ pageCount: number;
29
+ total: number;
30
+ }
31
+ export interface StrapiError {
32
+ data: null;
33
+ error: {
34
+ status: number;
35
+ name: string;
36
+ message: string;
37
+ details: Record<string, unknown>;
38
+ };
39
+ }
40
+ export interface StrapiMediaFormat {
41
+ url: string;
42
+ width: number;
43
+ height: number;
44
+ name?: string;
45
+ hash?: string;
46
+ ext?: string;
47
+ mime?: string;
48
+ size?: number;
49
+ }
50
+ export interface StrapiMedia {
51
+ id: number;
52
+ documentId: string;
53
+ name: string;
54
+ alternativeText: string | null;
55
+ caption: string | null;
56
+ width: number;
57
+ height: number;
58
+ formats: Partial<{
59
+ thumbnail: StrapiMediaFormat;
60
+ small: StrapiMediaFormat;
61
+ medium: StrapiMediaFormat;
62
+ large: StrapiMediaFormat;
63
+ }>;
64
+ hash: string;
65
+ ext: string;
66
+ mime: string;
67
+ size: number;
68
+ url: string;
69
+ previewUrl: string | null;
70
+ provider: string;
71
+ createdAt: string;
72
+ updatedAt: string;
73
+ }
74
+ export interface BlockTextChild {
75
+ type: 'text';
76
+ text: string;
77
+ bold?: boolean;
78
+ italic?: boolean;
79
+ underline?: boolean;
80
+ strikethrough?: boolean;
81
+ code?: boolean;
82
+ }
83
+ export interface BlockLinkChild {
84
+ type: 'link';
85
+ url: string;
86
+ children: BlockTextChild[];
87
+ }
88
+ export type BlockInlineNode = BlockTextChild | BlockLinkChild;
89
+ export interface BlockParagraph {
90
+ type: 'paragraph';
91
+ children: BlockInlineNode[];
92
+ }
93
+ export interface BlockHeading {
94
+ type: 'heading';
95
+ level: 1 | 2 | 3 | 4 | 5 | 6;
96
+ children: BlockInlineNode[];
97
+ }
98
+ export interface BlockList {
99
+ type: 'list';
100
+ format: 'ordered' | 'unordered';
101
+ children: BlockListItem[];
102
+ }
103
+ export interface BlockListItem {
104
+ type: 'list-item';
105
+ children: BlockInlineNode[];
106
+ }
107
+ export interface BlockQuote {
108
+ type: 'quote';
109
+ children: BlockInlineNode[];
110
+ }
111
+ export interface BlockCode {
112
+ type: 'code';
113
+ children: BlockTextChild[];
114
+ }
115
+ export interface BlockImage {
116
+ type: 'image';
117
+ image: StrapiMedia;
118
+ children: [{
119
+ type: 'text';
120
+ text: '';
121
+ }];
122
+ }
123
+ export type BlockNode = BlockParagraph | BlockHeading | BlockList | BlockQuote | BlockCode | BlockImage;
124
+ /** Strapi blocks editor JSON content */
125
+ export type BlocksContent = BlockNode[];
126
+ //# sourceMappingURL=strapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strapi.d.ts","sourceRoot":"","sources":["../../src/types/strapi.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;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,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,EAAE,CAAA;KAAE,CAAC,CAAC;CACxC;AAED,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,YAAY,GACZ,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Strapi v5 framework types
2
+ // These mirror the core response/document structures from Strapi REST API
3
+ export {};
4
+ //# sourceMappingURL=strapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strapi.js","sourceRoot":"","sources":["../../src/types/strapi.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,0EAA0E"}
@@ -0,0 +1,2 @@
1
+ export { getMediaUrl, getAssetUrl } from './media.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getMediaUrl, getAssetUrl } from './media.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { StrapiMedia } from '../types/strapi.js';
2
+ /**
3
+ * Resolve a Strapi media URL to an absolute URL.
4
+ * Handles both relative paths (prepends mediaHost) and absolute URLs (returns as-is).
5
+ */
6
+ export declare function getMediaUrl(url: string | undefined | null, mediaHost?: string): string;
7
+ /**
8
+ * Get a specific format URL from a StrapiMedia asset.
9
+ * Falls back to the original URL if the requested format is not available.
10
+ */
11
+ export declare function getAssetUrl(asset: StrapiMedia | null | undefined, format?: 'thumbnail' | 'small' | 'medium' | 'large', mediaHost?: string): string;
12
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/utils/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAKtF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACrC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,EACnD,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAMR"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Resolve a Strapi media URL to an absolute URL.
3
+ * Handles both relative paths (prepends mediaHost) and absolute URLs (returns as-is).
4
+ */
5
+ export function getMediaUrl(url, mediaHost) {
6
+ if (!url)
7
+ return '';
8
+ if (url.startsWith('http://') || url.startsWith('https://'))
9
+ return url;
10
+ const host = mediaHost ?? '';
11
+ return `${host}${url}`;
12
+ }
13
+ /**
14
+ * Get a specific format URL from a StrapiMedia asset.
15
+ * Falls back to the original URL if the requested format is not available.
16
+ */
17
+ export function getAssetUrl(asset, format, mediaHost) {
18
+ if (!asset)
19
+ return '';
20
+ if (format && asset.formats?.[format]) {
21
+ return getMediaUrl(asset.formats[format].url, mediaHost);
22
+ }
23
+ return getMediaUrl(asset.url, mediaHost);
24
+ }
25
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/utils/media.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAA8B,EAAE,SAAkB;IAC5E,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,GAAG,CAAC;IACxE,MAAM,IAAI,GAAG,SAAS,IAAI,EAAE,CAAC;IAC7B,OAAO,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,KAAqC,EACrC,MAAmD,EACnD,SAAkB;IAElB,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,OAAO,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@dani-builder/strapi-client",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript client for Daniworks Builder CMS (Strapi v5)",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./types": {
13
+ "types": "./dist/types/index.d.ts",
14
+ "import": "./dist/types/index.js"
15
+ },
16
+ "./client": {
17
+ "types": "./dist/client/index.d.ts",
18
+ "import": "./dist/client/index.js"
19
+ },
20
+ "./populate": {
21
+ "types": "./dist/populate/index.d.ts",
22
+ "import": "./dist/populate/index.js"
23
+ },
24
+ "./api": {
25
+ "types": "./dist/api/index.d.ts",
26
+ "import": "./dist/api/index.js"
27
+ },
28
+ "./utils": {
29
+ "types": "./dist/utils/index.d.ts",
30
+ "import": "./dist/utils/index.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/hojinzs/daniworks-builder-v2.git",
42
+ "directory": "packages/strapi-client"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc"
46
+ },
47
+ "dependencies": {
48
+ "axios": "^1.7.0",
49
+ "qs": "^6.13.0"
50
+ },
51
+ "devDependencies": {
52
+ "@repo/typescript-config": "workspace:*",
53
+ "@types/qs": "^6.9.0",
54
+ "typescript": "5.9.2"
55
+ }
56
+ }