@peam-ai/next 0.1.3 → 0.1.4

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,16 +1,12 @@
1
1
  import { NextConfig, NextAdapter } from 'next';
2
+ import { SearchExporterConfig, SearchIndexExporter } from '@peam-ai/search';
2
3
 
3
- interface PeamAdapterConfig {
4
+ interface PeamConfig {
4
5
  /**
5
- * Directory where the search index and pages.json will be output
6
- * @default '.peam'
6
+ * Search exporter configuration
7
+ * @default { type: 'fileBased', config: { indexPath: '.peam/index.json' } }
7
8
  */
8
- outputDir?: string;
9
- /**
10
- * Filename for the search index
11
- * @default 'index.json'
12
- */
13
- indexFilename?: string;
9
+ searchExporter?: SearchExporterConfig;
14
10
  /**
15
11
  * Whether to respect robots.txt rules when indexing pages
16
12
  * @default true
@@ -31,18 +27,12 @@ interface PeamAdapterConfig {
31
27
  */
32
28
  exclude?: string[];
33
29
  }
34
- type ResolvedPeamAdapterConfig = Required<Omit<PeamAdapterConfig, 'robotsTxtPath'>> & {
30
+ type ResolvedPeamAdapterConfig = Required<Omit<PeamConfig, 'robotsTxtPath' | 'searchExporter'>> & {
35
31
  robotsTxtPath?: string;
32
+ searchIndexExporter: SearchIndexExporter;
36
33
  };
37
- declare const defaultConfig: {
38
- outputDir: string;
39
- indexFilename: string;
40
- respectRobotsTxt: true;
41
- robotsTxtPath: undefined;
42
- exclude: never[];
43
- };
34
+ declare function setNextConfig(nextConfig: NextConfig, peamConfig?: PeamConfig): void;
44
35
  declare const getConfig: () => ResolvedPeamAdapterConfig;
45
- declare function setNextConfig(nextConfig: NextConfig, peamConfig: PeamAdapterConfig): void;
46
36
 
47
37
  declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapter;
48
38
 
@@ -59,6 +49,6 @@ declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapt
59
49
  * });
60
50
  * ```
61
51
  */
62
- declare function withPeam(peamConfig?: PeamAdapterConfig): (nextConfig?: NextConfig) => NextConfig;
52
+ declare function withPeam(peamConfig?: PeamConfig): (nextConfig?: NextConfig) => NextConfig;
63
53
 
64
- export { type PeamAdapterConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, defaultConfig, getConfig, setNextConfig, withPeam };
54
+ export { type PeamConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, getConfig, setNextConfig, withPeam };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  import { NextConfig, NextAdapter } from 'next';
2
+ import { SearchExporterConfig, SearchIndexExporter } from '@peam-ai/search';
2
3
 
3
- interface PeamAdapterConfig {
4
+ interface PeamConfig {
4
5
  /**
5
- * Directory where the search index and pages.json will be output
6
- * @default '.peam'
6
+ * Search exporter configuration
7
+ * @default { type: 'fileBased', config: { indexPath: '.peam/index.json' } }
7
8
  */
8
- outputDir?: string;
9
- /**
10
- * Filename for the search index
11
- * @default 'index.json'
12
- */
13
- indexFilename?: string;
9
+ searchExporter?: SearchExporterConfig;
14
10
  /**
15
11
  * Whether to respect robots.txt rules when indexing pages
16
12
  * @default true
@@ -31,18 +27,12 @@ interface PeamAdapterConfig {
31
27
  */
32
28
  exclude?: string[];
33
29
  }
34
- type ResolvedPeamAdapterConfig = Required<Omit<PeamAdapterConfig, 'robotsTxtPath'>> & {
30
+ type ResolvedPeamAdapterConfig = Required<Omit<PeamConfig, 'robotsTxtPath' | 'searchExporter'>> & {
35
31
  robotsTxtPath?: string;
32
+ searchIndexExporter: SearchIndexExporter;
36
33
  };
37
- declare const defaultConfig: {
38
- outputDir: string;
39
- indexFilename: string;
40
- respectRobotsTxt: true;
41
- robotsTxtPath: undefined;
42
- exclude: never[];
43
- };
34
+ declare function setNextConfig(nextConfig: NextConfig, peamConfig?: PeamConfig): void;
44
35
  declare const getConfig: () => ResolvedPeamAdapterConfig;
45
- declare function setNextConfig(nextConfig: NextConfig, peamConfig: PeamAdapterConfig): void;
46
36
 
47
37
  declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapter;
48
38
 
@@ -59,6 +49,6 @@ declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapt
59
49
  * });
60
50
  * ```
61
51
  */
62
- declare function withPeam(peamConfig?: PeamAdapterConfig): (nextConfig?: NextConfig) => NextConfig;
52
+ declare function withPeam(peamConfig?: PeamConfig): (nextConfig?: NextConfig) => NextConfig;
63
53
 
64
- export { type PeamAdapterConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, defaultConfig, getConfig, setNextConfig, withPeam };
54
+ export { type PeamConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, getConfig, setNextConfig, withPeam };