@docslurp/contrib-algolia-server 0.3.0 → 0.4.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [Package docs](https://docslurp.io/docs/packages/contrib-algolia-server) · [GitHub](https://github.com/DocSlurp/docslurp-oss/tree/main/packages/contrib-algolia-server) · [npm](https://www.npmjs.com/package/@docslurp/contrib-algolia-server)
4
4
 
5
- Sync Algolia-style settings, synonyms, rules and imports into DocSlurp from a backend job, migration script or API adapter. `createDocSlurpAlgoliaServerClient()` wraps [`@docslurp/contrib-search-compat/algolia`](https://docslurp.io/docs/packages/contrib-search-compat) and adds `searchIndex`, `syncSettings`, `syncSynonyms` and `syncRules`. Use it with a server key; writes are refused for browser keys.
5
+ Sync Algolia-style settings, synonyms, rules and imports into DocSlurp from a backend job, migration script or API adapter. `createDocSlurpAlgoliaServerClient()` wraps [`@docslurp/contrib-search-compat/algolia`](https://docslurp.io/docs/packages/contrib-search-compat) and adds `searchIndex`, `syncSettings`, `syncSynonyms` and `syncRules`. Use it with a server key: writes need the `workspaces:manage` scope, which only organization owners and admins can grant, and are refused for browser keys.
6
6
 
7
7
  ## Install and use
8
8
 
@@ -15,7 +15,7 @@ import { createDocSlurpAlgoliaServerClient } from "@docslurp/contrib-algolia-ser
15
15
 
16
16
  const client = createDocSlurpAlgoliaServerClient({
17
17
  apiUrl: "https://docslurp.io",
18
- clientKey: process.env.DOCSLURP_API_KEY!, // A server key. The option is named clientKey.
18
+ clientKey: process.env.DOCSLURP_API_KEY!, // A server key with the workspaces:manage scope. The option is named clientKey.
19
19
  });
20
20
 
21
21
  const res = await client.searchIndex("product-manuals", { query: "invoice" });
package/dist/index.d.ts CHANGED
@@ -3,19 +3,6 @@ export type DocSlurpAlgoliaServerClientOptions = DocSlurpAlgoliaClientOptions &
3
3
  defaultIndexName?: string;
4
4
  };
5
5
  export declare function createDocSlurpAlgoliaServerClient(options: DocSlurpAlgoliaServerClientOptions): {
6
- searchIndex: (indexName: string, request: AlgoliaSearchRequest) => Promise<AlgoliaSearchResponse>;
7
- syncSettings: (indexName: string, settings: AlgoliaCompatSettings) => Promise<{
8
- ok: boolean;
9
- settings: AlgoliaCompatSettings;
10
- }>;
11
- syncSynonyms: (indexName: string, synonyms: AlgoliaSynonymEntry[]) => Promise<{
12
- updatedAt: string;
13
- count: number;
14
- }>;
15
- syncRules: (indexName: string, rules: AlgoliaRuleEntry[]) => Promise<{
16
- updatedAt: string;
17
- count: number;
18
- }>;
19
6
  initIndex: (indexName: string) => {
20
7
  search: (query: string | AlgoliaSearchRequest, params?: Omit<AlgoliaSearchRequest, "query">) => Promise<AlgoliaSearchResponse>;
21
8
  getSettings: () => Promise<AlgoliaCompatSettings>;
@@ -129,5 +116,18 @@ export declare function createDocSlurpAlgoliaServerClient(options: DocSlurpAlgol
129
116
  results: AlgoliaSearchResponse[];
130
117
  }>;
131
118
  importIndex: (payload: Record<string, unknown>) => Promise<unknown>;
119
+ searchIndex: (indexName: string, request: AlgoliaSearchRequest) => Promise<AlgoliaSearchResponse>;
120
+ syncSettings: (indexName: string, settings: AlgoliaCompatSettings) => Promise<{
121
+ ok: boolean;
122
+ settings: AlgoliaCompatSettings;
123
+ }>;
124
+ syncSynonyms: (indexName: string, synonyms: AlgoliaSynonymEntry[]) => Promise<{
125
+ updatedAt: string;
126
+ count: number;
127
+ }>;
128
+ syncRules: (indexName: string, rules: AlgoliaRuleEntry[]) => Promise<{
129
+ updatedAt: string;
130
+ count: number;
131
+ }>;
132
132
  };
133
133
  export default createDocSlurpAlgoliaServerClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docslurp/contrib-algolia-server",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Server-side Algolia-style wrapper for syncing settings, synonyms, rules and imports into DocSlurp.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docslurp.io/docs/packages/contrib-algolia-server",
@@ -23,11 +23,11 @@
23
23
  "LICENSES"
24
24
  ],
25
25
  "dependencies": {
26
- "@docslurp/contrib-search-compat": "^0.3.0"
26
+ "@docslurp/contrib-search-compat": "^0.4.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^26.6.5",
30
- "typescript": "^6.0.3"
29
+ "@types/node": "^26.6.6",
30
+ "typescript": "^7.0.2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"