@leadcms/sdk 1.2.88-pre → 1.2.90-pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,9 +48,29 @@ npm install -g @leadcms/sdk
48
48
 
49
49
  LeadCMS SDK supports multiple configuration methods in order of priority:
50
50
 
51
- ### 1. Configuration File (Recommended)
51
+ ### 1. Environment Variables (Recommended for API credentials)
52
52
 
53
- Create a `leadcms.config.json` file in your project root:
53
+ For security reasons, it's best to keep sensitive credentials as environment variables:
54
+
55
+ ```bash
56
+ # Required - keep these as environment variables for security
57
+ LEADCMS_URL=your-leadcms-instance-url
58
+ LEADCMS_API_KEY=your-api-key
59
+
60
+ # Optional - can also be set via environment variables
61
+ LEADCMS_DEFAULT_LANGUAGE=en
62
+ LEADCMS_CONTENT_DIR=.leadcms/content
63
+ LEADCMS_MEDIA_DIR=public/media
64
+ LEADCMS_ENABLE_DRAFTS=true
65
+
66
+ # Next.js users can also use:
67
+ NEXT_PUBLIC_LEADCMS_URL=your-leadcms-instance-url
68
+ NEXT_PUBLIC_LEADCMS_DEFAULT_LANGUAGE=en
69
+ ```
70
+
71
+ ### 2. Configuration File (For project-specific settings)
72
+
73
+ Create a `leadcms.config.json` file **only if you need to override default settings** like `contentDir`, `mediaDir`, or `defaultLanguage`:
54
74
 
55
75
  ```bash
56
76
  # Initialize configuration file
@@ -59,8 +79,6 @@ npx leadcms init
59
79
 
60
80
  ```json
61
81
  {
62
- "url": "https://your-leadcms-instance.com",
63
- "apiKey": "your-api-key-here",
64
82
  "defaultLanguage": "en",
65
83
  "contentDir": ".leadcms/content",
66
84
  "mediaDir": "public/media",
@@ -68,9 +86,11 @@ npx leadcms init
68
86
  }
69
87
  ```
70
88
 
71
- > **Note:** Content types are automatically detected from your LeadCMS API - no need to configure them manually!
89
+ > **Security Note:** Avoid putting `url` and `apiKey` in config files. Environment variables are safer and work better with deployment platforms.
90
+
91
+ ### 3. Programmatic Configuration
72
92
 
73
- ### 2. Programmatic Configuration
93
+ For advanced use cases, you can configure the SDK programmatically:
74
94
 
75
95
  ```typescript
76
96
  import { configure } from '@leadcms/sdk';
@@ -78,26 +98,23 @@ import { configure } from '@leadcms/sdk';
78
98
  configure({
79
99
  url: 'https://your-leadcms-instance.com',
80
100
  apiKey: 'your-api-key',
81
- defaultLanguage: 'en'
101
+ defaultLanguage: 'en',
102
+ contentDir: '.leadcms/content',
103
+ mediaDir: 'public/media',
104
+ enableDrafts: false
82
105
  });
83
106
  ```
84
107
 
85
- ### 3. Environment Variables (Fallback)
108
+ > **Best Practice:** Use environment variables for `url` and `apiKey`, and programmatic configuration only for project-specific overrides.
86
109
 
87
- ```bash
88
- # Required
89
- LEADCMS_URL=your-leadcms-instance-url
90
- LEADCMS_API_KEY=your-api-key
91
-
92
- # Optional
93
- LEADCMS_DEFAULT_LANGUAGE=en
94
- LEADCMS_CONTENT_DIR=.leadcms/content
95
- LEADCMS_MEDIA_DIR=public/media
110
+ ### Configuration Options
96
111
 
97
- # Next.js users can also use:
98
- NEXT_PUBLIC_LEADCMS_URL=your-leadcms-instance-url
99
- NEXT_PUBLIC_LEADCMS_DEFAULT_LANGUAGE=en
100
- ```
112
+ - `url` - Your LeadCMS instance URL (**required**, best as env var)
113
+ - `apiKey` - Your LeadCMS API key (**required**, best as env var)
114
+ - `defaultLanguage` - Default language code (default: "en")
115
+ - `contentDir` - Directory for downloaded content (default: ".leadcms/content")
116
+ - `mediaDir` - Directory for media files (default: "public/media")
117
+ - `enableDrafts` - Enable draft content support (default: false)
101
118
 
102
119
  ## CLI Usage
103
120
 
@@ -128,97 +145,17 @@ npx leadcms watch
128
145
  npx leadcms generate-env
129
146
  ```
130
147
 
131
- ## Core Functions
132
148
 
133
- ```typescript
134
- import {
135
- getCMSContentBySlugForLocale,
136
- getAllContentSlugsForLocale,
137
- getAllContentRoutes,
138
- getAvailableLanguages,
139
- configure
140
- } from '@leadcms/sdk';
141
-
142
- // Option 1: Use configuration file (recommended)
143
- // Content directory from config: .leadcms/content
144
- const content = getCMSContentBySlugForLocale('about-us', undefined, 'en');
145
-
146
- // Option 2: Programmatic configuration
147
- configure({
148
- url: 'https://your-instance.com',
149
- apiKey: 'your-key',
150
- contentDir: '.leadcms/content'
151
- });
152
-
153
- // Option 3: Specify content directory explicitly
154
- const content = getCMSContentBySlugForLocale('about-us', '.leadcms/content', 'en');
155
-
156
- // Get all content slugs for a locale
157
- const slugs = getAllContentSlugsForLocale('.leadcms/content', 'en');
158
-
159
- // Get all routes (framework-agnostic)
160
- const routes = getAllContentRoutes('.leadcms/content');
161
- // Returns: [{ locale: 'en', slug: 'about-us', path: '/about-us', ... }]
162
-
163
- // Get available languages (uses configured contentDir if not specified)
164
- const languages = getAvailableLanguages();
165
-
166
- // Get content with draft support
167
- const draftContent = getCMSContentBySlugForLocaleWithDraftSupport(
168
- 'about-us',
169
- '.leadcms/content',
170
- 'en',
171
- 'user-uuid-for-drafts'
172
- );
173
-
174
- // Load configuration objects
175
- const headerConfig = getHeaderConfig('.leadcms/content', 'en');
176
- const footerConfig = getFooterConfig('.leadcms/content', 'en');
177
-
178
- // Advanced configuration loading with draft support
179
- import {
180
- loadConfigWithDraftSupport,
181
- loadContentConfig,
182
- getHeaderConfigAuto,
183
- getFooterConfigAuto
184
- } from '@leadcms/sdk';
185
-
186
- // Generic config loading with explicit paths
187
- const customConfig = loadConfigWithDraftSupport(
188
- '.leadcms/content',
189
- 'en',
190
- 'navigation',
191
- 'user-uuid-for-drafts'
192
- );
193
-
194
- // Convenience functions using configured contentDir
195
- const headerAuto = getHeaderConfigAuto('en', 'user-uuid-for-drafts');
196
- const footerAuto = getFooterConfigAuto(); // Uses default language
197
-
198
- // Generic config loading with auto contentDir resolution
199
- const menuConfig = loadContentConfig('menu', 'en', 'user-uuid-for-drafts');
200
-
201
- // Strict config loading with detailed error information (throws on missing files)
202
- try {
203
- const requiredConfig = loadContentConfigStrict('layout', 'en');
204
- } catch (error) {
205
- console.log('Missing config:', error.configName);
206
- console.log('Expected locale:', error.locale);
207
- console.log('Expected path:', error.message);
208
- }
209
- ```
210
149
 
211
150
  ## Framework Integration
212
151
 
213
152
  The SDK provides framework-agnostic data access. Most frameworks use it as a **development dependency** for build-time static generation:
214
153
 
215
154
  ```typescript
216
- // Next.js App Router (Build-time only - devDependency)
217
- import { getAllContentRoutes, getCMSContentBySlugForLocale } from '@leadcms/sdk';
218
-
155
+ // Next.js Static Generation (Build-time only - devDependency)
219
156
  export function generateStaticParams() {
220
157
  // This runs at BUILD TIME, not runtime
221
- const routes = getAllContentRoutes('.leadcms/content');
158
+ const routes = getAllContentRoutes();
222
159
  return routes.map(route => ({
223
160
  slug: route.slugParts,
224
161
  ...(route.isDefaultLocale ? {} : { locale: route.locale })
@@ -228,7 +165,7 @@ export function generateStaticParams() {
228
165
  // Astro Static Generation (Build-time only - devDependency)
229
166
  export function getStaticPaths() {
230
167
  // This runs at BUILD TIME, not runtime
231
- const routes = getAllContentRoutes('.leadcms/content');
168
+ const routes = getAllContentRoutes();
232
169
  return routes.map(route => ({
233
170
  params: { slug: route.slug },
234
171
  props: { locale: route.locale, path: route.path }
@@ -238,7 +175,7 @@ export function getStaticPaths() {
238
175
  // Gatsby Static Generation (Build-time only - devDependency)
239
176
  exports.createPages = async ({ actions }) => {
240
177
  const { createPage } = actions;
241
- const routes = getAllContentRoutes('.leadcms/content');
178
+ const routes = getAllContentRoutes();
242
179
 
243
180
  routes.forEach(route => {
244
181
  createPage({
@@ -256,18 +193,77 @@ import { getCMSContentBySlugForLocale } from '@leadcms/sdk';
256
193
 
257
194
  export async function GET(request) {
258
195
  // This runs at REQUEST TIME, needs production dependency
259
- const content = getCMSContentBySlugForLocale('about', '.leadcms/content', 'en');
196
+ const content = getCMSContentBySlugForLocale('about', 'en');
260
197
  return Response.json(content);
261
198
  }
262
199
 
263
200
  // Express.js Server (Runtime)
264
201
  app.get('/api/content/:slug', (req, res) => {
265
202
  // This runs at REQUEST TIME, needs production dependency
266
- const content = getCMSContentBySlugForLocale(req.params.slug, '.leadcms/content', 'en');
203
+ const content = getCMSContentBySlugForLocale(req.params.slug, 'en');
267
204
  res.json(content);
268
205
  });
269
206
  ```
270
207
 
208
+ ## API Reference
209
+
210
+ ### Core Functions
211
+
212
+ ```typescript
213
+ import {
214
+ getCMSContentBySlugForLocale,
215
+ getAllContentSlugsForLocale,
216
+ getAllContentRoutes,
217
+ getAvailableLanguages,
218
+ configure
219
+ } from '@leadcms/sdk';
220
+
221
+ // Get content by slug and locale
222
+ const content = getCMSContentBySlugForLocale('about-us', 'en');
223
+
224
+ // Get all content slugs for a locale
225
+ const slugs = getAllContentSlugsForLocale('en');
226
+
227
+ // Get all routes (framework-agnostic)
228
+ const routes = getAllContentRoutes();
229
+ // Returns: [{ locale: 'en', slug: 'about-us', path: '/about-us', ... }]
230
+
231
+ // Get available languages (uses configured contentDir)
232
+ const languages = getAvailableLanguages();
233
+
234
+ // Get content with draft support
235
+ const draftContent = getCMSContentBySlugForLocaleWithDraftSupport(
236
+ 'about-us',
237
+ 'en',
238
+ 'user-uuid-for-drafts'
239
+ );
240
+
241
+ // Load configuration objects (header, footer, etc.)
242
+ const headerConfig = getHeaderConfig('en');
243
+ const footerConfig = getFooterConfig('en');
244
+ ```
245
+
246
+ ### Advanced Configuration Loading
247
+
248
+ ```typescript
249
+ import {
250
+ loadContentConfig,
251
+ loadContentConfigStrict
252
+ } from '@leadcms/sdk';
253
+
254
+ // Generic config loading with auto contentDir resolution
255
+ const menuConfig = loadContentConfig('menu', 'en', 'user-uuid-for-drafts');
256
+
257
+ // Strict config loading with detailed error information (throws on missing files)
258
+ try {
259
+ const requiredConfig = loadContentConfigStrict('layout', 'en');
260
+ } catch (error) {
261
+ console.log('Missing config:', error.configName);
262
+ console.log('Expected locale:', error.locale);
263
+ console.log('Expected path:', error.message);
264
+ }
265
+ ```
266
+
271
267
  ## Docker Deployment
272
268
 
273
269
  LeadCMS SDK includes framework-agnostic Docker templates for easy deployment:
@@ -410,7 +406,40 @@ try {
410
406
 
411
407
  ## Development
412
408
 
409
+ For SDK development and contributions:
410
+
413
411
  ```bash
412
+ # Clone and setup
413
+ git clone https://github.com/LeadCMS/leadcms.sdk.git
414
+ cd leadcms-sdk
415
+ npm install
416
+
417
+ # Development workflow
414
418
  npm run build # Build the SDK
415
419
  npm run dev # Watch mode for development
420
+ npm run test # Run tests
421
+ npm run clean # Clean build artifacts
422
+
423
+ # Local testing with npm link
424
+ npm link
425
+ cd ../your-test-project
426
+ npm link @leadcms/sdk
416
427
  ```
428
+
429
+ ### Debug Mode
430
+
431
+ Enable detailed logging during development:
432
+
433
+ ```bash
434
+ LEADCMS_DEBUG=true npm run build
435
+ ```
436
+
437
+ ### Contributing
438
+
439
+ 1. Fork the repository
440
+ 2. Create a feature branch
441
+ 3. Make your changes
442
+ 4. Run tests: `npm run test`
443
+ 5. Submit a pull request
444
+
445
+ For detailed development setup, see [DEVELOPMENT.md](./DEVELOPMENT.md).
package/dist/cli/index.js CHANGED
@@ -81,12 +81,12 @@ Usage:
81
81
  leadcms generate-env - Generate environment variables file
82
82
 
83
83
  Configuration:
84
- Create a leadcms.config.json file in your project root, or set environment variables:
84
+ Set required environment variables (recommended for security):
85
+ LEADCMS_URL=your-leadcms-instance-url
86
+ LEADCMS_API_KEY=your-api-key
85
87
 
86
- Config file example:
88
+ Optional: Create leadcms.config.json for project-specific settings:
87
89
  {
88
- "url": "https://your-leadcms-instance.com",
89
- "apiKey": "your-api-key",
90
90
  "defaultLanguage": "en",
91
91
  "contentDir": ".leadcms/content",
92
92
  "mediaDir": "public/media"
@@ -104,20 +104,21 @@ Configuration:
104
104
  break;
105
105
  }
106
106
  function initializeConfig() {
107
- Promise.resolve().then(() => __importStar(require('fs'))).then(fs => {
107
+ Promise.all([Promise.resolve().then(() => __importStar(require('fs'))), Promise.resolve().then(() => __importStar(require('readline')))]).then(([fs, readline]) => {
108
108
  const configPath = 'leadcms.config.json';
109
109
  if (fs.existsSync(configPath)) {
110
- console.log('❓ leadcms.config.json already exists. Overwrite? (y/N)');
111
- process.stdin.setRawMode(true);
112
- process.stdin.resume();
113
- process.stdin.on('data', (key) => {
114
- if (key.toString().toLowerCase() === 'y') {
110
+ const rl = readline.createInterface({
111
+ input: process.stdin,
112
+ output: process.stdout
113
+ });
114
+ rl.question('❓ leadcms.config.json already exists. Overwrite? (y/N): ', (answer) => {
115
+ if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
115
116
  createConfigFile(configPath);
116
117
  }
117
118
  else {
118
- console.log('\\n✅ Configuration initialization cancelled.');
119
+ console.log('✅ Configuration initialization cancelled.');
119
120
  }
120
- process.exit(0);
121
+ rl.close();
121
122
  });
122
123
  }
123
124
  else {
@@ -127,18 +128,13 @@ function initializeConfig() {
127
128
  }
128
129
  function createConfigFile(configPath) {
129
130
  Promise.resolve().then(() => __importStar(require('fs'))).then(fs => {
130
- const sampleConfig = {
131
- "url": "https://your-leadcms-instance.com",
132
- "apiKey": "your-api-key-here",
133
- "defaultLanguage": "en",
134
- "contentDir": ".leadcms/content",
135
- "mediaDir": "public/media",
136
- "enableDrafts": false
137
- };
138
- const content = JSON.stringify(sampleConfig, null, 2);
139
- fs.writeFileSync(configPath, content, 'utf-8');
131
+ // Use the sample config file as the source of truth
132
+ const sampleConfigPath = path_1.default.join(__dirname, '../../leadcms.config.json.sample');
133
+ const sampleConfig = fs.readFileSync(sampleConfigPath, 'utf-8');
134
+ fs.writeFileSync(configPath, sampleConfig, 'utf-8');
140
135
  console.log(`✅ Created ${configPath}`);
141
- console.log('📝 Please edit the configuration file with your LeadCMS details.');
136
+ console.log('📝 Set LEADCMS_URL and LEADCMS_API_KEY as environment variables.');
137
+ console.log('🔧 Customize contentDir, mediaDir, or other settings in the config file.');
142
138
  console.log('ℹ️ Content types are automatically detected from your LeadCMS API.');
143
139
  });
144
140
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;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,KAAK,CAAC,CAAC;oBAChC,CAAC;oBAED,OAAO,CAAC,GAAG,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;gBACvC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,IAAI,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;YAC9D,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;YAC9D,OAAO,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC;YAC5F,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YACjC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;YAClF,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;YAC7E,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;QAEhF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/lib/cms.d.ts CHANGED
@@ -1,11 +1,18 @@
1
- import { type LeadCMSConfigOptions } from "./config";
1
+ import { type LeadCMSConfig } from "./config";
2
2
  export interface HeaderConfig {
3
3
  [key: string]: any;
4
4
  }
5
5
  export interface FooterConfig {
6
6
  [key: string]: any;
7
7
  }
8
- export declare const DEFAULT_LANGUAGE = "en";
8
+ /**
9
+ * Get LeadCMS configuration with fallbacks
10
+ * This function attempts to load the LeadCMS configuration and falls back to environment variables
11
+ * if the configuration file is not available or cannot be loaded.
12
+ *
13
+ * @returns Complete LeadCMS configuration object with all required fields
14
+ */
15
+ export declare function getLeadCMSConfig(): LeadCMSConfig;
9
16
  export interface CMSContentTemplateProps<T = CMSContent> {
10
17
  content: T;
11
18
  }
@@ -27,36 +34,34 @@ export interface CMSContent {
27
34
  /**
28
35
  * Get all available languages from the content directory structure
29
36
  */
30
- export declare function getAvailableLanguages(contentDir?: string, configOptions?: LeadCMSConfigOptions): string[];
37
+ export declare function getAvailableLanguages(): string[];
31
38
  /**
32
39
  * Get content directory for a specific locale
33
40
  */
34
- export declare function getContentDirForLocale(contentDir: string, locale: string, configOptions?: LeadCMSConfigOptions): string;
41
+ export declare function getContentDirForLocale(contentDir: string, locale?: string): string;
35
42
  /**
36
43
  * Get all content slugs for a specific locale with draft filtering options
37
- * @param contentDir - Content directory path
38
44
  * @param locale - Locale code
39
45
  * @param contentTypes - Optional array of content types to filter
40
46
  * @param includeDrafts - Whether to include draft content (default: null = false)
41
47
  * @param draftUserUid - Specific user UID for draft content (only relevant if includeDrafts is true)
42
48
  */
43
- export declare function getAllContentSlugsForLocale(contentDir: string, locale: string, contentTypes?: readonly string[], includeDrafts?: boolean | null, draftUserUid?: string | null): string[];
49
+ export declare function getAllContentSlugsForLocale(locale?: string, contentTypes?: readonly string[], includeDrafts?: boolean | null, draftUserUid?: string | null): string[];
44
50
  /**
45
51
  * Get content by slug for a specific locale with optional draft support
46
52
  * @param slug - Content slug
47
- * @param contentDir - Content directory path
48
53
  * @param locale - Locale code
49
54
  * @param userUid - Optional user UID for draft content
50
55
  */
51
- export declare function getCMSContentBySlugForLocaleWithDraftSupport(slug: string, contentDir: string, locale: string, userUid?: string | null): CMSContent | null;
56
+ export declare function getCMSContentBySlugForLocaleWithDraftSupport(slug: string, locale: string, userUid?: string | null): CMSContent | null;
52
57
  /**
53
58
  * Get content by slug for a specific locale
54
59
  */
55
- export declare function getCMSContentBySlugForLocale(slug: string, contentDir: string, locale: string): CMSContent | null;
60
+ export declare function getCMSContentBySlugForLocale(slug: string, locale?: string): CMSContent | null;
56
61
  /**
57
62
  * Get all translations of a content item by translationKey
58
63
  */
59
- export declare function getContentTranslations(translationKey: string, contentDir: string): {
64
+ export declare function getContentTranslations(translationKey: string): {
60
65
  locale: string;
61
66
  content: CMSContent;
62
67
  }[];
@@ -64,7 +69,7 @@ export declare function getContentTranslations(translationKey: string, contentDi
64
69
  * Get all content routes for all locales in a framework-agnostic format
65
70
  * Returns an array of route objects with locale and slug information
66
71
  */
67
- export declare function getAllContentRoutes(contentDir: string, contentTypes?: readonly string[], includeDrafts?: boolean | null, draftUserUid?: string | null): {
72
+ export declare function getAllContentRoutes(contentTypes?: readonly string[], includeDrafts?: boolean | null, draftUserUid?: string | null): {
68
73
  locale: string;
69
74
  slug: string;
70
75
  slugParts: string[];
@@ -77,58 +82,49 @@ export declare function getAllContentRoutes(contentDir: string, contentTypes?: r
77
82
  * @returns userUid if found, null otherwise
78
83
  */
79
84
  export declare function extractUserUidFromSlug(slug: string): string | null;
80
- export declare function getAllContentSlugs(contentDir: string, contentTypes?: readonly string[]): string[];
81
- export declare function getCMSContentBySlug(slug: string, contentDir: string): CMSContent | null;
85
+ export declare function getAllContentSlugs(contentTypes?: readonly string[]): string[];
86
+ export declare function getCMSContentBySlug(slug: string): CMSContent | null;
82
87
  /**
83
88
  * Convenience function to load configuration with automatic contentDir resolution
84
89
  * Uses the configured contentDir from the LeadCMS configuration system
85
90
  * @param configName - Name of the config file (e.g., 'header', 'footer', 'contact', 'navigation')
86
91
  * @param locale - Locale code (optional, uses default language from config if not provided)
87
92
  * @param userUid - Optional user UID for draft content
88
- * @param configOptions - Optional LeadCMS configuration options
89
93
  * @returns Parsed config object or null if not found
90
94
  */
91
- export declare function loadContentConfig<T>(configName: string, locale?: string, userUid?: string | null, configOptions?: LeadCMSConfigOptions): T | null;
95
+ export declare function loadContentConfig<T>(configName: string, locale?: string, userUid?: string | null): T | null;
92
96
  /**
93
97
  * Load header configuration using configured contentDir
94
98
  * @param locale - Locale code (optional, uses default language from config if not provided)
95
99
  * @param userUid - Optional user UID for draft content
96
- * @param configOptions - Optional LeadCMS configuration options
97
100
  */
98
- export declare function getHeaderConfig(locale?: string, userUid?: string | null, configOptions?: LeadCMSConfigOptions): HeaderConfig | null;
101
+ export declare function getHeaderConfig(locale?: string, userUid?: string | null): HeaderConfig | null;
99
102
  /**
100
103
  * Load footer configuration using configured contentDir
101
104
  * @param locale - Locale code (optional, uses default language from config if not provided)
102
105
  * @param userUid - Optional user UID for draft content
103
- * @param configOptions - Optional LeadCMS configuration options
104
106
  */
105
- export declare function getFooterConfig(locale?: string, userUid?: string | null, configOptions?: LeadCMSConfigOptions): FooterConfig | null;
107
+ export declare function getFooterConfig(locale?: string, userUid?: string | null): FooterConfig | null;
106
108
  /**
107
109
  * Get the current locale from a path
110
+ * @param pathname - The pathname to extract locale from
111
+ * @param contentDir - Content directory path (optional, uses configured contentDir if not provided)
108
112
  */
109
113
  export declare function getLocaleFromPath(pathname: string): string;
110
114
  /**
111
115
  * Make a link locale-aware by adding the current locale prefix
116
+ * @param href - The href to make locale-aware
117
+ * @param currentLocale - The current locale
112
118
  */
113
119
  export declare function makeLocaleAwareLink(href: string, currentLocale: string): string;
114
- /**
115
- * Load layout configuration using configured contentDir
116
- * Uses the configured contentDir automatically
117
- * @param locale - Locale code (optional, uses default language from config if not provided)
118
- * @param userUid - Optional user UID for draft content
119
- * @param configOptions - Optional LeadCMS configuration options
120
- * @returns Parsed layout config object or null if not found
121
- */
122
- export declare function getLayoutConfig(locale?: string, userUid?: string | null, configOptions?: LeadCMSConfigOptions): any | null;
123
120
  /**
124
121
  * Load configuration with detailed error information for debugging
125
122
  * Unlike loadContentConfig, this throws descriptive errors instead of returning null
126
123
  * @param configName - Name of the config file
127
124
  * @param locale - Locale code (optional, uses default language from config if not provided)
128
125
  * @param userUid - Optional user UID for draft content
129
- * @param configOptions - Optional LeadCMS configuration options
130
126
  * @returns Parsed config object (never returns null)
131
127
  * @throws {Error} With detailed information about missing files including configName, locale, and expected path
132
128
  */
133
- export declare function loadContentConfigStrict<T>(configName: string, locale?: string, userUid?: string | null, configOptions?: LeadCMSConfigOptions): T;
129
+ export declare function loadContentConfigStrict<T>(configName: string, locale?: string, userUid?: string | null): T;
134
130
  //# sourceMappingURL=cms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cms.d.ts","sourceRoot":"","sources":["../../src/lib/cms.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiC,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGpF,MAAM,WAAW,YAAY;IAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CAAE;AACrD,MAAM,WAAW,YAAY;IAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CAAE;AAGrD,eAAO,MAAM,gBAAgB,OAAO,CAAC;AA+BrC,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,UAAU;IACrD,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,MAAM,EAAE,CA0BzG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,M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