@tinacms/search 1.0.28 → 1.0.30

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.
@@ -1,10 +1,10 @@
1
1
  import type { SearchClient } from '../types';
2
2
  import { MemoryLevel } from 'memory-level';
3
- declare type TinaSearchIndexerClientOptions = {
3
+ type TinaSearchIndexerClientOptions = {
4
4
  stopwordLanguages?: string[];
5
5
  tokenSplitRegex?: string;
6
6
  };
7
- declare type TinaCloudSearchIndexerClientOptions = {
7
+ type TinaCloudSearchIndexerClientOptions = {
8
8
  apiUrl: string;
9
9
  branch: string;
10
10
  indexerToken: string;
package/dist/index.js CHANGED
@@ -263,10 +263,9 @@ var SearchIndexer = class {
263
263
 
264
264
  // src/client/index.ts
265
265
  var import_sqlite_level = require("sqlite-level");
266
- var zlib = __toESM(require("zlib"));
267
266
  var import_search_index = __toESM(require("search-index"));
268
267
  var import_memory_level = require("memory-level");
269
- var import_node_fetch = __toESM(require("node-fetch"));
268
+ var zlib = __toESM(require("zlib"));
270
269
  var DEFAULT_TOKEN_SPLIT_REGEX = /[\p{L}\d_]+/gu;
271
270
  var LocalSearchIndexClient = class {
272
271
  constructor(options) {
@@ -318,10 +317,10 @@ var TinaCMSSearchIndexClient = class extends LocalSearchIndexClient {
318
317
  this.indexerToken = options.indexerToken;
319
318
  }
320
319
  async onFinishIndexing() {
321
- const headers = new import_node_fetch.Headers();
320
+ const headers = new Headers();
322
321
  headers.append("x-api-key", this.indexerToken || "bogus");
323
322
  headers.append("Content-Type", "application/json");
324
- let res = await (0, import_node_fetch.default)(`${this.apiUrl}/upload/${this.branch}`, {
323
+ let res = await fetch(`${this.apiUrl}/upload/${this.branch}`, {
325
324
  method: "GET",
326
325
  headers
327
326
  });
@@ -344,7 +343,7 @@ var TinaCMSSearchIndexClient = class extends LocalSearchIndexClient {
344
343
  }
345
344
  const buffer = sqliteLevel.db.serialize();
346
345
  await sqliteLevel.close();
347
- res = await (0, import_node_fetch.default)(signedUrl, {
346
+ res = await fetch(signedUrl, {
348
347
  method: "PUT",
349
348
  body: zlib.gzipSync(buffer)
350
349
  });
@@ -1,7 +1,7 @@
1
1
  import { TinaSchema } from '@tinacms/schema-tools';
2
2
  import { Bridge } from '@tinacms/graphql';
3
3
  import { SearchClient } from '../types';
4
- declare type SearchIndexOptions = {
4
+ type SearchIndexOptions = {
5
5
  batchSize?: number;
6
6
  bridge: Bridge;
7
7
  client: SearchClient;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type SearchClient = {
1
+ export type SearchClient = {
2
2
  query: (query: string, options?: {
3
3
  cursor?: string;
4
4
  limit?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/search",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index-client.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -30,12 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "memory-level": "^1.0.0",
33
- "node-fetch": "2",
34
33
  "search-index": "4.0.0",
35
- "sqlite-level": "^1.0.1",
36
- "stopword": "^2.0.8",
37
- "@tinacms/graphql": "1.5.2",
38
- "@tinacms/schema-tools": "1.6.2"
34
+ "sqlite-level": "^1.2.0",
35
+ "stopword": "^3.1.1",
36
+ "@tinacms/graphql": "1.5.3",
37
+ "@tinacms/schema-tools": "1.6.3"
39
38
  },
40
39
  "publishConfig": {
41
40
  "registry": "https://registry.npmjs.org"
@@ -45,15 +44,16 @@
45
44
  "directory": "packages/@tinacms/search"
46
45
  },
47
46
  "devDependencies": {
48
- "@types/jest": "^26.0.4",
49
- "@types/micromatch": "^4.0.2",
50
- "@types/search-index": "^3.2.0",
51
- "jest": "^29.5.0",
52
- "jest-diff": "^29.5.0",
53
- "jest-file-snapshot": "^0.5.0",
54
- "jest-matcher-utils": "^29.5.0",
55
- "typescript": "4.6.4",
56
- "@tinacms/scripts": "1.2.1"
47
+ "@types/jest": "^29.5.13",
48
+ "@types/micromatch": "^4.0.9",
49
+ "@types/node": "^22.7.3",
50
+ "@types/search-index": "^3.2.4",
51
+ "jest": "^29.7.0",
52
+ "jest-diff": "^29.7.0",
53
+ "jest-file-snapshot": "^0.7.0",
54
+ "jest-matcher-utils": "^29.7.0",
55
+ "typescript": "^5.6.2",
56
+ "@tinacms/scripts": "1.2.2"
57
57
  },
58
58
  "scripts": {
59
59
  "types": "pnpm tsc",