@leadcms/sdk 2.1.5 â 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +331 -6
- package/dist/cli/index.js +97 -68
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/auth.d.ts +55 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +204 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/cms-config-types.d.ts +57 -0
- package/dist/lib/cms-config-types.d.ts.map +1 -0
- package/dist/lib/cms-config-types.js +64 -0
- package/dist/lib/cms-config-types.js.map +1 -0
- package/dist/lib/cms.d.ts +52 -0
- package/dist/lib/cms.d.ts.map +1 -1
- package/dist/lib/cms.js +113 -0
- package/dist/lib/cms.js.map +1 -1
- package/dist/lib/comment-types.d.ts +73 -0
- package/dist/lib/comment-types.d.ts.map +1 -0
- package/dist/lib/comment-types.js +6 -0
- package/dist/lib/comment-types.js.map +1 -0
- package/dist/lib/comment-utils.d.ts +173 -0
- package/dist/lib/comment-utils.d.ts.map +1 -0
- package/dist/lib/comment-utils.js +338 -0
- package/dist/lib/comment-utils.js.map +1 -0
- package/dist/lib/config.d.ts +4 -2
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +10 -4
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/data-service.d.ts.map +1 -1
- package/dist/lib/data-service.js +22 -6
- package/dist/lib/data-service.js.map +1 -1
- package/dist/scripts/fetch-leadcms-comments.d.ts +26 -0
- package/dist/scripts/fetch-leadcms-comments.d.ts.map +1 -0
- package/dist/scripts/fetch-leadcms-comments.js +352 -0
- package/dist/scripts/fetch-leadcms-comments.js.map +1 -0
- package/dist/scripts/fetch-leadcms-content.d.ts.map +1 -1
- package/dist/scripts/fetch-leadcms-content.js +86 -39
- package/dist/scripts/fetch-leadcms-content.js.map +1 -1
- package/dist/scripts/init-leadcms.d.ts +7 -0
- package/dist/scripts/init-leadcms.d.ts.map +1 -0
- package/dist/scripts/init-leadcms.js +397 -0
- package/dist/scripts/init-leadcms.js.map +1 -0
- package/dist/scripts/leadcms-helpers.d.ts +2 -2
- package/dist/scripts/leadcms-helpers.d.ts.map +1 -1
- package/dist/scripts/leadcms-helpers.js +12 -7
- package/dist/scripts/leadcms-helpers.js.map +1 -1
- package/dist/scripts/login-leadcms.d.ts +10 -0
- package/dist/scripts/login-leadcms.d.ts.map +1 -0
- package/dist/scripts/login-leadcms.js +90 -0
- package/dist/scripts/login-leadcms.js.map +1 -0
- package/dist/scripts/pull-all.d.ts +12 -0
- package/dist/scripts/pull-all.d.ts.map +1 -0
- package/dist/scripts/pull-all.js +81 -0
- package/dist/scripts/pull-all.js.map +1 -0
- package/dist/scripts/pull-comments.d.ts +11 -0
- package/dist/scripts/pull-comments.d.ts.map +1 -0
- package/dist/scripts/pull-comments.js +45 -0
- package/dist/scripts/pull-comments.js.map +1 -0
- package/dist/scripts/pull-content.d.ts +11 -0
- package/dist/scripts/pull-content.d.ts.map +1 -0
- package/dist/scripts/pull-content.js +45 -0
- package/dist/scripts/pull-content.js.map +1 -0
- package/dist/scripts/pull-media.d.ts +12 -0
- package/dist/scripts/pull-media.d.ts.map +1 -0
- package/dist/scripts/pull-media.js +46 -0
- package/dist/scripts/pull-media.js.map +1 -0
- package/dist/scripts/push-leadcms-content.d.ts.map +1 -1
- package/dist/scripts/push-leadcms-content.js +12 -0
- package/dist/scripts/push-leadcms-content.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,37 @@ npm install -g @leadcms/sdk
|
|
|
44
44
|
- đ ī¸ Project initialization and setup
|
|
45
45
|
- đ ī¸ Content fetching and Docker template generation
|
|
46
46
|
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
Get started with LeadCMS in 3 simple steps:
|
|
50
|
+
|
|
51
|
+
### 1. Initialize Your Project
|
|
52
|
+
```bash
|
|
53
|
+
npx leadcms init
|
|
54
|
+
```
|
|
55
|
+
This will:
|
|
56
|
+
- Connect to your LeadCMS instance
|
|
57
|
+
- Detect available entity types (content, media, comments)
|
|
58
|
+
- Create configuration files (`.env` and optionally `leadcms.config.json`)
|
|
59
|
+
|
|
60
|
+
### 2. Authenticate (for write access)
|
|
61
|
+
```bash
|
|
62
|
+
npx leadcms login
|
|
63
|
+
```
|
|
64
|
+
- **LeadCMS v1.2.88+**: Automatic device authentication via browser
|
|
65
|
+
- **Older versions**: Guided manual token extraction
|
|
66
|
+
- Saves your API token securely to `.env`
|
|
67
|
+
|
|
68
|
+
**Skip this step** if you only need read-only access to public content.
|
|
69
|
+
|
|
70
|
+
### 3. Download Your Content
|
|
71
|
+
```bash
|
|
72
|
+
npx leadcms pull
|
|
73
|
+
```
|
|
74
|
+
Downloads all content, media, and comments to your local project.
|
|
75
|
+
|
|
76
|
+
**That's it!** You're ready to use LeadCMS content in your application. See [Usage Examples](#usage-examples) below.
|
|
77
|
+
|
|
47
78
|
## CI/CD Integration
|
|
48
79
|
|
|
49
80
|
[](https://github.com/LeadCMS/leadcms-sdk/actions/workflows/ci.yml)
|
|
@@ -143,7 +174,7 @@ LEADCMS_URL=http://localhost:3001 npx leadcms status
|
|
|
143
174
|
- `allNew` - Local content that doesn't exist remotely (default)
|
|
144
175
|
- `noChanges` - All content is in sync
|
|
145
176
|
- `hasConflicts` - Remote content is newer than local
|
|
146
|
-
- `hasUpdates` - Local content is newer than remote
|
|
177
|
+
- `hasUpdates` - Local content is newer than remote
|
|
147
178
|
- `mixedOperations` - Mix of new, updated, and conflicted content
|
|
148
179
|
- `missingContentTypes` - Content with unknown types
|
|
149
180
|
|
|
@@ -158,13 +189,18 @@ The data service abstraction automatically handles switching between real API ca
|
|
|
158
189
|
|
|
159
190
|
LeadCMS SDK supports multiple configuration methods in order of priority:
|
|
160
191
|
|
|
192
|
+
> **đ Quick Start:** Run `npx leadcms init` for an interactive setup wizard that handles everything!
|
|
193
|
+
|
|
161
194
|
### 1. Environment Variables (Recommended for API credentials)
|
|
162
195
|
|
|
163
196
|
For security reasons, it's best to keep sensitive credentials as environment variables:
|
|
164
197
|
|
|
165
198
|
```bash
|
|
166
|
-
# Required
|
|
199
|
+
# Required
|
|
167
200
|
LEADCMS_URL=your-leadcms-instance-url
|
|
201
|
+
|
|
202
|
+
# Optional - API key for authenticated access
|
|
203
|
+
# Omit this for public-only mode (published content only)
|
|
168
204
|
LEADCMS_API_KEY=your-api-key
|
|
169
205
|
|
|
170
206
|
# Optional - can also be set via environment variables
|
|
@@ -178,6 +214,8 @@ NEXT_PUBLIC_LEADCMS_URL=your-leadcms-instance-url
|
|
|
178
214
|
NEXT_PUBLIC_LEADCMS_DEFAULT_LANGUAGE=en
|
|
179
215
|
```
|
|
180
216
|
|
|
217
|
+
> **īŋŊ Security Note:** The SDK uses a **security-first approach** - all read operations (content, comments, media sync) are performed WITHOUT authentication, ensuring only public data is retrieved. API keys are only used for write operations. See [Public API Mode Guide](./docs/PUBLIC_API_MODE.md) for details.
|
|
218
|
+
|
|
181
219
|
### 2. Configuration File (For project-specific settings)
|
|
182
220
|
|
|
183
221
|
Create a `leadcms.config.json` file **only if you need to override default settings** like `contentDir`, `mediaDir`, or `defaultLanguage`:
|
|
@@ -220,31 +258,145 @@ configure({
|
|
|
220
258
|
### Configuration Options
|
|
221
259
|
|
|
222
260
|
- `url` - Your LeadCMS instance URL (**required**, best as env var)
|
|
223
|
-
- `apiKey` - Your LeadCMS API key (**
|
|
261
|
+
- `apiKey` - Your LeadCMS API key (**optional**, omit for public-only mode, best as env var when used)
|
|
224
262
|
- `defaultLanguage` - Default language code (default: "en")
|
|
225
263
|
- `contentDir` - Directory for downloaded content (default: ".leadcms/content")
|
|
226
264
|
- `mediaDir` - Directory for media files (default: "public/media")
|
|
227
|
-
- `enableDrafts` - Enable draft content support (default: false)
|
|
265
|
+
- `enableDrafts` - Enable draft content support (default: false, requires API key)
|
|
228
266
|
|
|
229
267
|
## CLI Usage
|
|
230
268
|
|
|
269
|
+
### Check SDK version
|
|
270
|
+
```bash
|
|
271
|
+
npx leadcms version
|
|
272
|
+
# or
|
|
273
|
+
npx leadcms -v
|
|
274
|
+
# or
|
|
275
|
+
npx leadcms --version
|
|
276
|
+
```
|
|
277
|
+
|
|
231
278
|
### Initialize configuration
|
|
232
279
|
```bash
|
|
233
280
|
npx leadcms init
|
|
234
|
-
# Creates leadcms.config.json with sample configuration
|
|
235
281
|
```
|
|
236
282
|
|
|
283
|
+
Interactive setup wizard that:
|
|
284
|
+
1. **Connects to your LeadCMS instance** - Validates URL and checks for existing authentication
|
|
285
|
+
2. **Fetches configuration** - Retrieves default language and available languages from public `/api/config` endpoint
|
|
286
|
+
3. **Configures directories** - Sets content and media directories (defaults: `.leadcms/content`, `public/media`)
|
|
287
|
+
4. **Creates environment file** - Saves configuration to `.env` or `.env.local`
|
|
288
|
+
5. **Creates config file** - Only if you use non-default directories (keeps your project clean!)
|
|
289
|
+
|
|
290
|
+
**Note:** The `/api/config` endpoint is public and works without authentication. For write operations and private content, run `leadcms login` after initialization.
|
|
291
|
+
|
|
292
|
+
### Login to LeadCMS
|
|
293
|
+
```bash
|
|
294
|
+
npx leadcms login
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Authenticates with your LeadCMS instance:
|
|
298
|
+
- **Device Authentication** (LeadCMS v1.2.88+) - Opens a browser link for secure authentication
|
|
299
|
+
- **Manual Token** (older versions) - Guides you through extracting an API token
|
|
300
|
+
- **Saves token** - Automatically stores the token in your `.env` file
|
|
301
|
+
|
|
302
|
+
**When to use:**
|
|
303
|
+
- After running `leadcms init` if you need write access
|
|
304
|
+
- To update an expired or invalid token
|
|
305
|
+
- When switching between LeadCMS instances
|
|
306
|
+
|
|
307
|
+
Example session (with existing authentication):
|
|
308
|
+
```
|
|
309
|
+
đ LeadCMS SDK Initialization
|
|
310
|
+
|
|
311
|
+
Enter your LeadCMS URL: https://your-instance.leadcms.io
|
|
312
|
+
|
|
313
|
+
â API key found in environment
|
|
314
|
+
|
|
315
|
+
đ Connecting to LeadCMS...
|
|
316
|
+
â
Connected successfully!
|
|
317
|
+
|
|
318
|
+
đ Available languages:
|
|
319
|
+
1. English (United States) [en-US] (default)
|
|
320
|
+
2. Russian (Russia) [ru-RU]
|
|
321
|
+
|
|
322
|
+
â Using default language: en-US
|
|
323
|
+
|
|
324
|
+
Content directory [.leadcms/content]:
|
|
325
|
+
Media directory [public/media]:
|
|
326
|
+
|
|
327
|
+
â
Updated .env
|
|
328
|
+
âšī¸ Using default directories, no leadcms.config.json needed.
|
|
329
|
+
|
|
330
|
+
⨠Configuration complete!
|
|
331
|
+
|
|
332
|
+
Next steps:
|
|
333
|
+
1. Run: npx leadcms pull (to download content)
|
|
334
|
+
2. Start using LeadCMS content in your project
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Example session (without authentication):
|
|
338
|
+
```
|
|
339
|
+
đ LeadCMS SDK Initialization
|
|
340
|
+
|
|
341
|
+
Enter your LeadCMS URL: https://your-instance.leadcms.io
|
|
342
|
+
|
|
343
|
+
âšī¸ No API key found.
|
|
344
|
+
âĸ For read-only access: Continue without API key (public content only)
|
|
345
|
+
âĸ For full access: Run "leadcms login" after initialization
|
|
346
|
+
|
|
347
|
+
Continue without API key? (Y/n): y
|
|
348
|
+
âšī¸ Continuing in read-only mode.
|
|
349
|
+
|
|
350
|
+
đ Connecting to LeadCMS...
|
|
351
|
+
â
Connected successfully!
|
|
352
|
+
|
|
353
|
+
đ Available languages:
|
|
354
|
+
1. English (United States) [en-US] (default)
|
|
355
|
+
2. Russian (Russia) [ru-RU]
|
|
356
|
+
|
|
357
|
+
â Using default language: en-US
|
|
358
|
+
|
|
359
|
+
Content directory [.leadcms/content]:
|
|
360
|
+
Media directory [public/media]:
|
|
361
|
+
|
|
362
|
+
â
Updated .env
|
|
363
|
+
âšī¸ Using default directories, no leadcms.config.json needed.
|
|
364
|
+
|
|
365
|
+
⨠Configuration complete!
|
|
366
|
+
|
|
367
|
+
Next steps:
|
|
368
|
+
1. Run: npx leadcms login (for write access and private content)
|
|
369
|
+
2. Run: npx leadcms pull (to download content)
|
|
370
|
+
3. Start using LeadCMS content in your project
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
The wizard creates:
|
|
374
|
+
- **`.env`** (or `.env.local` if exists) with `LEADCMS_URL`, `LEADCMS_DEFAULT_LANGUAGE`, and optionally `LEADCMS_API_KEY`
|
|
375
|
+
- **`leadcms.config.json`** only if custom directories are specified
|
|
376
|
+
|
|
377
|
+
**Anonymous Mode:** Perfect for static sites that only need public content. Omit the API key to skip authentication entirely.
|
|
378
|
+
|
|
237
379
|
### Generate Docker deployment templates
|
|
238
380
|
```bash
|
|
239
381
|
npx leadcms docker
|
|
240
382
|
# Creates Docker files for production and preview deployments
|
|
241
383
|
```
|
|
242
384
|
|
|
243
|
-
### Pull content from LeadCMS
|
|
385
|
+
### Pull content and comments from LeadCMS
|
|
244
386
|
```bash
|
|
245
387
|
npx leadcms pull
|
|
246
388
|
```
|
|
247
389
|
|
|
390
|
+
This command will:
|
|
391
|
+
- Sync all content from LeadCMS to local files
|
|
392
|
+
- Sync all comments to `.leadcms/comments/` directory
|
|
393
|
+
- Update sync tokens for incremental updates
|
|
394
|
+
|
|
395
|
+
To pull only comments:
|
|
396
|
+
```bash
|
|
397
|
+
npx leadcms pull-comments
|
|
398
|
+
```
|
|
399
|
+
|
|
248
400
|
> **Note:** `npx leadcms fetch` is still supported as an alias for backward compatibility.
|
|
249
401
|
|
|
250
402
|
### Push local content to LeadCMS
|
|
@@ -411,6 +563,179 @@ try {
|
|
|
411
563
|
}
|
|
412
564
|
```
|
|
413
565
|
|
|
566
|
+
### Comments Support
|
|
567
|
+
|
|
568
|
+
LeadCMS SDK provides full support for working with comments on your content. Comments are automatically synced when you run `npx leadcms pull` and stored locally in `.leadcms/comments/` directory organized by entity type and ID.
|
|
569
|
+
|
|
570
|
+
#### Syncing Comments
|
|
571
|
+
|
|
572
|
+
```bash
|
|
573
|
+
# Pull both content and comments (recommended)
|
|
574
|
+
npx leadcms pull
|
|
575
|
+
|
|
576
|
+
# Pull only comments
|
|
577
|
+
npx leadcms pull-comments
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
> **đĄ Note:** Comments are fetched **without authentication** for security. If you encounter 403 errors, check that your LeadCMS instance allows public access to comments. See [Public API Mode Guide](./docs/PUBLIC_API_MODE.md#troubleshooting) for troubleshooting.
|
|
581
|
+
|
|
582
|
+
Comments are stored in the following structure:
|
|
583
|
+
```
|
|
584
|
+
.leadcms/
|
|
585
|
+
comments/
|
|
586
|
+
Content/
|
|
587
|
+
10.json # Comments for Content with ID 10
|
|
588
|
+
20.json # Comments for Content with ID 20
|
|
589
|
+
Contact/
|
|
590
|
+
5.json # Comments for Contact with ID 5
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
#### Retrieving Comments
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
import {
|
|
597
|
+
getComments,
|
|
598
|
+
getCommentsForContent,
|
|
599
|
+
getCommentsStrict,
|
|
600
|
+
getCommentsForContentStrict
|
|
601
|
+
} from '@leadcms/sdk';
|
|
602
|
+
|
|
603
|
+
// Get comments for any commentable entity (returns empty array if not found)
|
|
604
|
+
const contentComments = getComments('Content', 10);
|
|
605
|
+
const contactComments = getComments('Contact', 5);
|
|
606
|
+
|
|
607
|
+
// Convenience function for content comments (most common use case)
|
|
608
|
+
const comments = getCommentsForContent(20);
|
|
609
|
+
|
|
610
|
+
// Strict versions that throw errors instead of returning empty arrays
|
|
611
|
+
try {
|
|
612
|
+
const strictComments = getCommentsStrict('Content', 10);
|
|
613
|
+
const strictContentComments = getCommentsForContentStrict(20);
|
|
614
|
+
} catch (error) {
|
|
615
|
+
console.error('Comments not found or invalid:', error.message);
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
#### Comment Structure
|
|
620
|
+
|
|
621
|
+
Each comment has the following structure:
|
|
622
|
+
|
|
623
|
+
```typescript
|
|
624
|
+
interface Comment {
|
|
625
|
+
id: number;
|
|
626
|
+
parentId?: number | null; // For nested/threaded comments
|
|
627
|
+
authorName: string;
|
|
628
|
+
authorEmail?: string;
|
|
629
|
+
body: string;
|
|
630
|
+
createdAt: string; // ISO 8601 format
|
|
631
|
+
updatedAt?: string | null; // ISO 8601 format
|
|
632
|
+
commentableId: number; // ID of the entity being commented on
|
|
633
|
+
commentableType: string; // Type of entity (e.g., "Content", "Contact")
|
|
634
|
+
avatarUrl?: string;
|
|
635
|
+
language: string;
|
|
636
|
+
translationKey?: string | null;
|
|
637
|
+
contactId?: number | null;
|
|
638
|
+
source?: string | null;
|
|
639
|
+
tags?: string[] | null;
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
#### Usage Examples
|
|
644
|
+
|
|
645
|
+
**Display comments on a blog post:**
|
|
646
|
+
|
|
647
|
+
```typescript
|
|
648
|
+
// Next.js example
|
|
649
|
+
import { getCMSContentBySlugForLocale, getCommentsForContent } from '@leadcms/sdk';
|
|
650
|
+
|
|
651
|
+
export default function BlogPost({ params }) {
|
|
652
|
+
const content = getCMSContentBySlugForLocale(params.slug, 'en');
|
|
653
|
+
const comments = content.id ? getCommentsForContent(content.id) : [];
|
|
654
|
+
|
|
655
|
+
return (
|
|
656
|
+
<article>
|
|
657
|
+
<h1>{content.title}</h1>
|
|
658
|
+
<div dangerouslySetInnerHTML={{ __html: content.body }} />
|
|
659
|
+
|
|
660
|
+
<section className="comments">
|
|
661
|
+
<h2>Comments ({comments.length})</h2>
|
|
662
|
+
{comments.map(comment => (
|
|
663
|
+
<div key={comment.id} className="comment">
|
|
664
|
+
<img src={comment.avatarUrl} alt={comment.authorName} />
|
|
665
|
+
<div>
|
|
666
|
+
<strong>{comment.authorName}</strong>
|
|
667
|
+
<time>{new Date(comment.createdAt).toLocaleDateString()}</time>
|
|
668
|
+
<p>{comment.body}</p>
|
|
669
|
+
</div>
|
|
670
|
+
</div>
|
|
671
|
+
))}
|
|
672
|
+
</section>
|
|
673
|
+
</article>
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
**Working with threaded comments:**
|
|
679
|
+
|
|
680
|
+
```typescript
|
|
681
|
+
import {
|
|
682
|
+
getCommentsTreeForContent,
|
|
683
|
+
flattenCommentTree
|
|
684
|
+
} from '@leadcms/sdk';
|
|
685
|
+
|
|
686
|
+
// Get comments as a tree with nested replies
|
|
687
|
+
const tree = getCommentsTreeForContent(20, {
|
|
688
|
+
sortOrder: 'newest', // Sort root comments newest first
|
|
689
|
+
replySortOrder: 'oldest' // Sort replies chronologically
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
// Each node has: id, body, authorName, children, depth, isLeaf, threadCount
|
|
693
|
+
tree.forEach(comment => {
|
|
694
|
+
console.log(`${comment.authorName}: ${comment.body}`);
|
|
695
|
+
console.log(` ${comment.threadCount - 1} replies`);
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// Flatten tree for display with indentation
|
|
699
|
+
const flat = flattenCommentTree(tree);
|
|
700
|
+
flat.forEach(comment => {
|
|
701
|
+
const indent = ' '.repeat(comment.depth);
|
|
702
|
+
console.log(`${indent}${comment.authorName}: ${comment.body}`);
|
|
703
|
+
});
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
**Advanced comment features:**
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
import {
|
|
710
|
+
getCommentsForContent,
|
|
711
|
+
searchComments,
|
|
712
|
+
getCommentStatistics,
|
|
713
|
+
filterComments,
|
|
714
|
+
getRecentComments
|
|
715
|
+
} from '@leadcms/sdk';
|
|
716
|
+
|
|
717
|
+
const comments = getCommentsForContent(10);
|
|
718
|
+
|
|
719
|
+
// Search comments
|
|
720
|
+
const results = searchComments(comments, 'react');
|
|
721
|
+
|
|
722
|
+
// Get statistics
|
|
723
|
+
const stats = getCommentStatistics(comments);
|
|
724
|
+
console.log(`${stats.total} comments, ${stats.threads} threads, ${stats.authors} authors`);
|
|
725
|
+
|
|
726
|
+
// Filter by language, tags, date range
|
|
727
|
+
const filtered = filterComments(comments, {
|
|
728
|
+
language: 'en',
|
|
729
|
+
tags: ['important'],
|
|
730
|
+
since: '2024-01-01'
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
// Get recent comments
|
|
734
|
+
const latest = getRecentComments(comments, 5);
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
> **đ See [Comment Tree Documentation](./docs/COMMENT_TREE.md)** for comprehensive guide on tree structures, sorting options, filtering, statistics, and more advanced features.
|
|
738
|
+
|
|
414
739
|
## Docker Deployment
|
|
415
740
|
|
|
416
741
|
LeadCMS SDK includes framework-agnostic Docker templates for easy deployment:
|
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
|
+
import { readFileSync } from 'fs';
|
|
5
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
7
|
const __dirname = path.dirname(__filename);
|
|
7
8
|
const command = process.argv[2];
|
|
@@ -17,10 +18,59 @@ function runScript(scriptName, args = []) {
|
|
|
17
18
|
process.exit(code || 0);
|
|
18
19
|
});
|
|
19
20
|
}
|
|
21
|
+
function runScriptSequence(scripts, args = []) {
|
|
22
|
+
let currentIndex = 0;
|
|
23
|
+
function runNext() {
|
|
24
|
+
if (currentIndex >= scripts.length) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const scriptName = scripts[currentIndex];
|
|
28
|
+
const scriptPath = path.join(scriptDir, scriptName);
|
|
29
|
+
const child = spawn('node', [scriptPath, ...args], {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
env: process.env
|
|
32
|
+
});
|
|
33
|
+
child.on('exit', (code) => {
|
|
34
|
+
if (code !== 0) {
|
|
35
|
+
process.exit(code || 0);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
currentIndex++;
|
|
39
|
+
runNext();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
runNext();
|
|
44
|
+
}
|
|
45
|
+
function getVersion() {
|
|
46
|
+
try {
|
|
47
|
+
const packageJsonPath = path.join(__dirname, '../../package.json');
|
|
48
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
49
|
+
return packageJson.version;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return 'unknown';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
20
55
|
switch (command) {
|
|
56
|
+
case 'version':
|
|
57
|
+
case '-v':
|
|
58
|
+
case '--version':
|
|
59
|
+
console.log(`LeadCMS SDK v${getVersion()}`);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
break;
|
|
21
62
|
case 'pull':
|
|
22
63
|
case 'fetch': // Alias for backward compatibility
|
|
23
|
-
runScript('
|
|
64
|
+
runScript('pull-all.js');
|
|
65
|
+
break;
|
|
66
|
+
case 'pull-content':
|
|
67
|
+
runScript('pull-content.js');
|
|
68
|
+
break;
|
|
69
|
+
case 'pull-media':
|
|
70
|
+
runScript('pull-media.js');
|
|
71
|
+
break;
|
|
72
|
+
case 'pull-comments':
|
|
73
|
+
runScript('pull-comments.js');
|
|
24
74
|
break;
|
|
25
75
|
case 'push':
|
|
26
76
|
runScript('push-leadcms-content.js', commandArgs);
|
|
@@ -36,7 +86,10 @@ switch (command) {
|
|
|
36
86
|
break;
|
|
37
87
|
case 'init':
|
|
38
88
|
case 'config':
|
|
39
|
-
|
|
89
|
+
runScript('init-leadcms.js');
|
|
90
|
+
break;
|
|
91
|
+
case 'login':
|
|
92
|
+
runScript('login-leadcms.js');
|
|
40
93
|
break;
|
|
41
94
|
case 'docker':
|
|
42
95
|
case 'templates':
|
|
@@ -44,93 +97,69 @@ switch (command) {
|
|
|
44
97
|
break;
|
|
45
98
|
default:
|
|
46
99
|
console.log(`
|
|
47
|
-
LeadCMS SDK CLI
|
|
100
|
+
LeadCMS SDK CLI v${getVersion()}
|
|
48
101
|
|
|
49
102
|
Usage:
|
|
103
|
+
leadcms version - Show SDK version
|
|
50
104
|
leadcms init - Initialize LeadCMS configuration
|
|
105
|
+
leadcms login - Authenticate and save API token to .env file
|
|
51
106
|
leadcms docker - Generate Docker deployment templates
|
|
52
|
-
|
|
107
|
+
|
|
108
|
+
Pull commands:
|
|
109
|
+
leadcms pull - Pull all content, media, and comments from LeadCMS
|
|
110
|
+
leadcms pull-content - Pull only content from LeadCMS
|
|
111
|
+
leadcms pull-media - Pull only media files from LeadCMS
|
|
112
|
+
leadcms pull-comments - Pull only comments from LeadCMS
|
|
113
|
+
leadcms fetch - Alias for 'pull' (backward compatibility)
|
|
114
|
+
|
|
115
|
+
Push commands:
|
|
53
116
|
leadcms push [options] - Push local content to LeadCMS
|
|
54
117
|
--force - Override remote changes (skip conflict check)
|
|
55
118
|
--dry-run - Show API calls without executing them (preview mode)
|
|
56
119
|
--id <content-id> - Target specific content by ID
|
|
57
120
|
--slug <slug> - Target specific content by slug
|
|
121
|
+
|
|
122
|
+
Status & monitoring:
|
|
58
123
|
leadcms status [options] - Show sync status between local and remote content
|
|
59
124
|
--preview - Show detailed change previews for all files
|
|
60
125
|
--id <content-id> - Show detailed status for specific content by ID
|
|
61
126
|
--slug <slug> - Show detailed status for specific content by slug
|
|
62
|
-
leadcms
|
|
63
|
-
|
|
127
|
+
leadcms watch - Watch for real-time updates via Server-Sent Events
|
|
128
|
+
|
|
129
|
+
Utilities:
|
|
64
130
|
leadcms generate-env - Generate environment variables file
|
|
65
131
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
132
|
+
Getting Started:
|
|
133
|
+
1. Initialize configuration:
|
|
134
|
+
leadcms init - Interactive setup wizard
|
|
135
|
+
|
|
136
|
+
2. Authenticate (optional, required for push operations):
|
|
137
|
+
leadcms login - Get and save API token
|
|
70
138
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"contentDir": ".leadcms/content",
|
|
75
|
-
"mediaDir": "public/media"
|
|
76
|
-
}
|
|
139
|
+
3. Start syncing:
|
|
140
|
+
leadcms pull - Download content from LeadCMS
|
|
141
|
+
leadcms push - Upload local changes
|
|
77
142
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
143
|
+
Configuration Files:
|
|
144
|
+
.env (recommended, created by 'leadcms login'):
|
|
145
|
+
LEADCMS_URL=https://your-instance.leadcms.io
|
|
146
|
+
LEADCMS_API_KEY=your-token-here
|
|
147
|
+
LEADCMS_DEFAULT_LANGUAGE=en
|
|
82
148
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
149
|
+
leadcms.config.json (created by 'leadcms init'):
|
|
150
|
+
{
|
|
151
|
+
"url": "https://your-instance.leadcms.io",
|
|
152
|
+
"defaultLanguage": "en",
|
|
153
|
+
"contentDir": "content",
|
|
154
|
+
"mediaDir": "public/media",
|
|
155
|
+
"commentsDir": "comments"
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Note: Environment variables take precedence over config file.
|
|
159
|
+
Next.js users can use NEXT_PUBLIC_LEADCMS_URL for client-side access.
|
|
86
160
|
`);
|
|
87
161
|
break;
|
|
88
162
|
}
|
|
89
|
-
function generateConfig() {
|
|
90
|
-
Promise.all([import('fs'), import('path')]).then(([fs, pathModule]) => {
|
|
91
|
-
const configPath = pathModule.join(process.cwd(), 'leadcms.config.json');
|
|
92
|
-
if (fs.existsSync(configPath)) {
|
|
93
|
-
const readline = require('readline');
|
|
94
|
-
const rl = readline.createInterface({
|
|
95
|
-
input: process.stdin,
|
|
96
|
-
output: process.stdout
|
|
97
|
-
});
|
|
98
|
-
rl.question('leadcms.config.json already exists. Overwrite? (y/N): ', (answer) => {
|
|
99
|
-
if (answer.toLowerCase() !== 'y' && answer.toLowerCase() !== 'yes') {
|
|
100
|
-
console.log('â
Configuration initialization cancelled.');
|
|
101
|
-
rl.close();
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
createConfig();
|
|
105
|
-
rl.close();
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
createConfig();
|
|
110
|
-
}
|
|
111
|
-
function createConfig() {
|
|
112
|
-
const sampleConfigPath = pathModule.join(__dirname, '../../leadcms.config.json.sample');
|
|
113
|
-
const sampleConfig = fs.readFileSync(sampleConfigPath, 'utf-8');
|
|
114
|
-
fs.writeFileSync(configPath, sampleConfig, 'utf-8');
|
|
115
|
-
console.log(`â
Created ${configPath}`);
|
|
116
|
-
console.log('đ Set LEADCMS_URL and LEADCMS_API_KEY as environment variables.');
|
|
117
|
-
console.log('đ§ Customize contentDir, mediaDir, or other settings in the config file.');
|
|
118
|
-
console.log('âšī¸ Content types are automatically detected from your LeadCMS API.');
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function createConfigFile(configPath) {
|
|
123
|
-
import('fs').then(fs => {
|
|
124
|
-
// Use the sample config file as the source of truth
|
|
125
|
-
const sampleConfigPath = path.join(__dirname, '../../leadcms.config.json.sample');
|
|
126
|
-
const sampleConfig = fs.readFileSync(sampleConfigPath, 'utf-8');
|
|
127
|
-
fs.writeFileSync(configPath, sampleConfig, 'utf-8');
|
|
128
|
-
console.log(`â
Created ${configPath}`);
|
|
129
|
-
console.log('đ Set LEADCMS_URL and LEADCMS_API_KEY as environment variables.');
|
|
130
|
-
console.log('đ§ Customize contentDir, mediaDir, or other settings in the config file.');
|
|
131
|
-
console.log('âšī¸ Content types are automatically detected from your LeadCMS API.');
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
163
|
function generateDockerTemplates() {
|
|
135
164
|
Promise.all([import('fs'), import('path')]).then(([fs, pathModule]) => {
|
|
136
165
|
const templateDir = pathModule.join(__dirname, '../templates');
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAElC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAErD,SAAS,SAAS,CAAC,UAAkB,EAAE,OAAiB,EAAE;IACxD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,EAAE;QACjD,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,O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,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/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from './lib/cms.js';
|
|
2
2
|
export * from './lib/config.js';
|
|
3
3
|
export * from './lib/locale-utils.js';
|
|
4
|
+
export * from './lib/comment-types.js';
|
|
5
|
+
export * from './lib/cms-config-types.js';
|
|
6
|
+
export * from './lib/auth.js';
|
|
7
|
+
export type { CommentTreeNode, CommentTreeOptions, CommentStatistics, CommentSortOrder } from './lib/comment-utils.js';
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAG9B,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|