@seo-console/package 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,81 +1,86 @@
1
- export { GenerateMetadataOptions, getRoutePathFromParams, useGenerateMetadata } from './hooks/index.mjs';
2
- import { S as SEORecord, C as CreateSEORecord, U as UpdateSEORecord } from './index-6lAOwFXQ.mjs';
3
- export { B as Button, d as Card, i as CardContent, h as CardDescription, f as CardFooter, e as CardHeader, g as CardTitle, I as Input, O as OGImagePreview, b as SEORecordForm, a as SEORecordList, j as Spinner, V as ValidationDashboard, c as createSEORecordSchema, u as updateSEORecordSchema } from './index-6lAOwFXQ.mjs';
4
- import 'next';
1
+ export { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, OGImagePreview, SEORecordForm, SEORecordList, Spinner, ValidationDashboard } from './components/index.mjs';
2
+ import { S as SEORecord, C as CreateSEORecord, U as UpdateSEORecord } from './seo-schema-D8EwzllB.mjs';
3
+ export { c as createSEORecordSchema, u as updateSEORecordSchema } from './seo-schema-D8EwzllB.mjs';
4
+ export { D as DiscoveredRoute, E as ExtractedMetadata, I as ImageValidationResult, R as RobotsTxtOptions, S as SitemapEntry, i as SitemapOptions, a as ValidationIssue, V as ValidationResult, c as crawlSiteForSEO, d as discoverNextJSRoutes, e as extractMetadataFromHTML, b as extractMetadataFromURL, k as extractSitemapFromRobotsTxt, g as generateExamplePaths, j as generateRobotsTxt, h as generateSitemapFromRecords, f as generateSitemapXML, m as metadataToSEORecord, s as seoRecordsToSitemapEntries, u as updateRobotsTxtWithSitemap, v as validateSitemapEntry } from './robots-generator-D6T5HVNx.mjs';
5
5
  import 'react/jsx-runtime';
6
- import 'zod';
7
6
  import 'react';
7
+ import 'zod';
8
8
 
9
- type ValidationSeverity = "critical" | "warning" | "info";
10
- interface ValidationIssue {
11
- field: string;
12
- severity: ValidationSeverity;
13
- message: string;
14
- expected?: string;
15
- actual?: string;
16
- }
17
- interface ValidationResult {
18
- isValid: boolean;
19
- issues: ValidationIssue[];
20
- validatedAt: Date;
21
- }
22
9
  /**
23
- * Validate HTML content against SEO record requirements
10
+ * Storage Adapter Interface
11
+ * Allows SEO Console to work with different storage backends
24
12
  */
25
- declare function validateHTML(html: string, record: SEORecord, _baseUrl?: string): Promise<ValidationResult>;
26
13
 
27
- interface ImageValidationResult {
28
- isValid: boolean;
29
- issues: Array<{
30
- field: string;
31
- severity: "critical" | "warning" | "info";
32
- message: string;
33
- expected?: string;
34
- actual?: string;
35
- }>;
36
- metadata?: {
37
- width: number;
38
- height: number;
39
- format: string;
40
- size: number;
41
- };
14
+ interface StorageAdapter {
15
+ /**
16
+ * Get all SEO records
17
+ */
18
+ getRecords(): Promise<SEORecord[]>;
19
+ /**
20
+ * Get a single SEO record by ID
21
+ */
22
+ getRecordById(id: string): Promise<SEORecord | null>;
23
+ /**
24
+ * Get SEO record by route path
25
+ */
26
+ getRecordByRoute(routePath: string): Promise<SEORecord | null>;
27
+ /**
28
+ * Create a new SEO record
29
+ */
30
+ createRecord(record: CreateSEORecord): Promise<SEORecord>;
31
+ /**
32
+ * Update an existing SEO record
33
+ */
34
+ updateRecord(record: UpdateSEORecord): Promise<SEORecord>;
35
+ /**
36
+ * Delete an SEO record
37
+ */
38
+ deleteRecord(id: string): Promise<void>;
39
+ /**
40
+ * Check if storage is available/configured
41
+ */
42
+ isAvailable(): Promise<boolean>;
43
+ }
44
+ type StorageType = "supabase" | "file" | "sqlite" | "memory";
45
+ interface StorageConfig {
46
+ type: StorageType;
47
+ supabaseUrl?: string;
48
+ supabaseKey?: string;
49
+ filePath?: string;
50
+ sqlitePath?: string;
42
51
  }
43
- /**
44
- * Validate OG image URL
45
- * Checks dimensions, format, file size, and accessibility
46
- */
47
- declare function validateOGImage(imageUrl: string, expectedWidth?: number, expectedHeight?: number): Promise<ImageValidationResult>;
48
52
 
49
- type Result<T, E = Error> = {
50
- success: true;
51
- data: T;
52
- } | {
53
- success: false;
54
- error: E;
55
- };
56
- /**
57
- * Get all SEO records for the current user
58
- */
59
- declare function getSEORecords(): Promise<Result<SEORecord[]>>;
60
53
  /**
61
- * Get a single SEO record by ID
54
+ * Storage Factory
55
+ * Creates the appropriate storage adapter based on configuration
62
56
  */
63
- declare function getSEORecordById(id: string): Promise<Result<SEORecord>>;
64
- /**
65
- * Get SEO record by route path
66
- */
67
- declare function getSEORecordByRoute(routePath: string): Promise<Result<SEORecord | null>>;
68
- /**
69
- * Create a new SEO record
70
- */
71
- declare function createSEORecord(record: CreateSEORecord): Promise<Result<SEORecord>>;
57
+
58
+ declare function createStorageAdapter(config: StorageConfig): StorageAdapter;
72
59
  /**
73
- * Update an existing SEO record
60
+ * Auto-detect storage type from environment
74
61
  */
75
- declare function updateSEORecord(record: UpdateSEORecord): Promise<Result<SEORecord>>;
62
+ declare function detectStorageConfig(): StorageConfig;
63
+
76
64
  /**
77
- * Delete an SEO record
65
+ * File-based storage adapter
66
+ * Stores SEO records in a JSON file
67
+ * No database required!
78
68
  */
79
- declare function deleteSEORecord(id: string): Promise<Result<void>>;
80
69
 
81
- export { CreateSEORecord, type ImageValidationResult, SEORecord, UpdateSEORecord, type ValidationIssue, type ValidationResult, createSEORecord, deleteSEORecord, getSEORecords as getAllSEORecords, getSEORecordById, getSEORecordByRoute, updateSEORecord, validateHTML, validateOGImage };
70
+ declare class FileStorage implements StorageAdapter {
71
+ private filePath;
72
+ private records;
73
+ private initialized;
74
+ constructor(filePath?: string);
75
+ private ensureInitialized;
76
+ private save;
77
+ isAvailable(): Promise<boolean>;
78
+ getRecords(): Promise<SEORecord[]>;
79
+ getRecordById(id: string): Promise<SEORecord | null>;
80
+ getRecordByRoute(routePath: string): Promise<SEORecord | null>;
81
+ createRecord(record: CreateSEORecord): Promise<SEORecord>;
82
+ updateRecord(record: UpdateSEORecord): Promise<SEORecord>;
83
+ deleteRecord(id: string): Promise<void>;
84
+ }
85
+
86
+ export { CreateSEORecord, FileStorage, SEORecord, type StorageAdapter, type StorageConfig, type StorageType, UpdateSEORecord, createStorageAdapter, detectStorageConfig };
package/dist/index.d.ts CHANGED
@@ -1,81 +1,86 @@
1
- export { GenerateMetadataOptions, getRoutePathFromParams, useGenerateMetadata } from './hooks/index.js';
2
- import { S as SEORecord, C as CreateSEORecord, U as UpdateSEORecord } from './index-6lAOwFXQ.js';
3
- export { B as Button, d as Card, i as CardContent, h as CardDescription, f as CardFooter, e as CardHeader, g as CardTitle, I as Input, O as OGImagePreview, b as SEORecordForm, a as SEORecordList, j as Spinner, V as ValidationDashboard, c as createSEORecordSchema, u as updateSEORecordSchema } from './index-6lAOwFXQ.js';
4
- import 'next';
1
+ export { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, OGImagePreview, SEORecordForm, SEORecordList, Spinner, ValidationDashboard } from './components/index.js';
2
+ import { S as SEORecord, C as CreateSEORecord, U as UpdateSEORecord } from './seo-schema-D8EwzllB.js';
3
+ export { c as createSEORecordSchema, u as updateSEORecordSchema } from './seo-schema-D8EwzllB.js';
4
+ export { D as DiscoveredRoute, E as ExtractedMetadata, I as ImageValidationResult, R as RobotsTxtOptions, S as SitemapEntry, i as SitemapOptions, a as ValidationIssue, V as ValidationResult, c as crawlSiteForSEO, d as discoverNextJSRoutes, e as extractMetadataFromHTML, b as extractMetadataFromURL, k as extractSitemapFromRobotsTxt, g as generateExamplePaths, j as generateRobotsTxt, h as generateSitemapFromRecords, f as generateSitemapXML, m as metadataToSEORecord, s as seoRecordsToSitemapEntries, u as updateRobotsTxtWithSitemap, v as validateSitemapEntry } from './robots-generator-B1KOf8vn.js';
5
5
  import 'react/jsx-runtime';
6
- import 'zod';
7
6
  import 'react';
7
+ import 'zod';
8
8
 
9
- type ValidationSeverity = "critical" | "warning" | "info";
10
- interface ValidationIssue {
11
- field: string;
12
- severity: ValidationSeverity;
13
- message: string;
14
- expected?: string;
15
- actual?: string;
16
- }
17
- interface ValidationResult {
18
- isValid: boolean;
19
- issues: ValidationIssue[];
20
- validatedAt: Date;
21
- }
22
9
  /**
23
- * Validate HTML content against SEO record requirements
10
+ * Storage Adapter Interface
11
+ * Allows SEO Console to work with different storage backends
24
12
  */
25
- declare function validateHTML(html: string, record: SEORecord, _baseUrl?: string): Promise<ValidationResult>;
26
13
 
27
- interface ImageValidationResult {
28
- isValid: boolean;
29
- issues: Array<{
30
- field: string;
31
- severity: "critical" | "warning" | "info";
32
- message: string;
33
- expected?: string;
34
- actual?: string;
35
- }>;
36
- metadata?: {
37
- width: number;
38
- height: number;
39
- format: string;
40
- size: number;
41
- };
14
+ interface StorageAdapter {
15
+ /**
16
+ * Get all SEO records
17
+ */
18
+ getRecords(): Promise<SEORecord[]>;
19
+ /**
20
+ * Get a single SEO record by ID
21
+ */
22
+ getRecordById(id: string): Promise<SEORecord | null>;
23
+ /**
24
+ * Get SEO record by route path
25
+ */
26
+ getRecordByRoute(routePath: string): Promise<SEORecord | null>;
27
+ /**
28
+ * Create a new SEO record
29
+ */
30
+ createRecord(record: CreateSEORecord): Promise<SEORecord>;
31
+ /**
32
+ * Update an existing SEO record
33
+ */
34
+ updateRecord(record: UpdateSEORecord): Promise<SEORecord>;
35
+ /**
36
+ * Delete an SEO record
37
+ */
38
+ deleteRecord(id: string): Promise<void>;
39
+ /**
40
+ * Check if storage is available/configured
41
+ */
42
+ isAvailable(): Promise<boolean>;
43
+ }
44
+ type StorageType = "supabase" | "file" | "sqlite" | "memory";
45
+ interface StorageConfig {
46
+ type: StorageType;
47
+ supabaseUrl?: string;
48
+ supabaseKey?: string;
49
+ filePath?: string;
50
+ sqlitePath?: string;
42
51
  }
43
- /**
44
- * Validate OG image URL
45
- * Checks dimensions, format, file size, and accessibility
46
- */
47
- declare function validateOGImage(imageUrl: string, expectedWidth?: number, expectedHeight?: number): Promise<ImageValidationResult>;
48
52
 
49
- type Result<T, E = Error> = {
50
- success: true;
51
- data: T;
52
- } | {
53
- success: false;
54
- error: E;
55
- };
56
- /**
57
- * Get all SEO records for the current user
58
- */
59
- declare function getSEORecords(): Promise<Result<SEORecord[]>>;
60
53
  /**
61
- * Get a single SEO record by ID
54
+ * Storage Factory
55
+ * Creates the appropriate storage adapter based on configuration
62
56
  */
63
- declare function getSEORecordById(id: string): Promise<Result<SEORecord>>;
64
- /**
65
- * Get SEO record by route path
66
- */
67
- declare function getSEORecordByRoute(routePath: string): Promise<Result<SEORecord | null>>;
68
- /**
69
- * Create a new SEO record
70
- */
71
- declare function createSEORecord(record: CreateSEORecord): Promise<Result<SEORecord>>;
57
+
58
+ declare function createStorageAdapter(config: StorageConfig): StorageAdapter;
72
59
  /**
73
- * Update an existing SEO record
60
+ * Auto-detect storage type from environment
74
61
  */
75
- declare function updateSEORecord(record: UpdateSEORecord): Promise<Result<SEORecord>>;
62
+ declare function detectStorageConfig(): StorageConfig;
63
+
76
64
  /**
77
- * Delete an SEO record
65
+ * File-based storage adapter
66
+ * Stores SEO records in a JSON file
67
+ * No database required!
78
68
  */
79
- declare function deleteSEORecord(id: string): Promise<Result<void>>;
80
69
 
81
- export { CreateSEORecord, type ImageValidationResult, SEORecord, UpdateSEORecord, type ValidationIssue, type ValidationResult, createSEORecord, deleteSEORecord, getSEORecords as getAllSEORecords, getSEORecordById, getSEORecordByRoute, updateSEORecord, validateHTML, validateOGImage };
70
+ declare class FileStorage implements StorageAdapter {
71
+ private filePath;
72
+ private records;
73
+ private initialized;
74
+ constructor(filePath?: string);
75
+ private ensureInitialized;
76
+ private save;
77
+ isAvailable(): Promise<boolean>;
78
+ getRecords(): Promise<SEORecord[]>;
79
+ getRecordById(id: string): Promise<SEORecord | null>;
80
+ getRecordByRoute(routePath: string): Promise<SEORecord | null>;
81
+ createRecord(record: CreateSEORecord): Promise<SEORecord>;
82
+ updateRecord(record: UpdateSEORecord): Promise<SEORecord>;
83
+ deleteRecord(id: string): Promise<void>;
84
+ }
85
+
86
+ export { CreateSEORecord, FileStorage, SEORecord, type StorageAdapter, type StorageConfig, type StorageType, UpdateSEORecord, createStorageAdapter, detectStorageConfig };