@blocklet/search-kit-js 0.2.16 → 0.2.18

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.cjs CHANGED
@@ -4,11 +4,11 @@ const meilisearch = require('meilisearch');
4
4
  const component = require('@blocklet/sdk/lib/component');
5
5
  const verifySign = require('@blocklet/sdk/lib/util/verify-sign');
6
6
  const axios = require('axios');
7
+ const ufo = require('ufo');
7
8
  const config = require('@blocklet/sdk/lib/config');
8
9
  const zod = require('zod');
9
10
  const getWallet = require('@blocklet/sdk/lib/wallet');
10
11
  const env = require('@blocklet/sdk/lib/env');
11
- const ufo = require('ufo');
12
12
  const crypto = require('crypto');
13
13
 
14
14
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -89,7 +89,7 @@ class SearchKitClient extends meilisearch.MeiliSearch {
89
89
  if (!endpoint)
90
90
  throw new Error("SearchKit Kit not found");
91
91
  super({
92
- host: `${endpoint}/api/meilisearch`,
92
+ host: ufo.joinURL(endpoint, "/api/meilisearch"),
93
93
  httpClient: async (url, opts) => {
94
94
  const body = typeof opts?.body === "string" ? JSON.parse(opts.body) : opts?.body ?? {};
95
95
  const headers = typeof opts?.headers === "string" ? JSON.parse(opts.headers) : opts?.headers ?? {};
package/dist/index.mjs CHANGED
@@ -3,11 +3,11 @@ export * from 'meilisearch';
3
3
  import { getComponentWebEndpoint, getComponentMountPoint } from '@blocklet/sdk/lib/component';
4
4
  import { sign } from '@blocklet/sdk/lib/util/verify-sign';
5
5
  import axios from 'axios';
6
+ import { joinURL } from 'ufo';
6
7
  import config from '@blocklet/sdk/lib/config';
7
8
  import { z } from 'zod';
8
9
  import getWallet from '@blocklet/sdk/lib/wallet';
9
10
  import env from '@blocklet/sdk/lib/env';
10
- import { joinURL } from 'ufo';
11
11
  import crypto from 'crypto';
12
12
 
13
13
  const SerpDocSchema = z.object({
@@ -80,7 +80,7 @@ class SearchKitClient extends MeiliSearch {
80
80
  if (!endpoint)
81
81
  throw new Error("SearchKit Kit not found");
82
82
  super({
83
- host: `${endpoint}/api/meilisearch`,
83
+ host: joinURL(endpoint, "/api/meilisearch"),
84
84
  httpClient: async (url, opts) => {
85
85
  const body = typeof opts?.body === "string" ? JSON.parse(opts.body) : opts?.body ?? {};
86
86
  const headers = typeof opts?.headers === "string" ? JSON.parse(opts.headers) : opts?.headers ?? {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/search-kit-js",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -19,13 +19,13 @@
19
19
  "README.md"
20
20
  ],
21
21
  "dependencies": {
22
- "axios": "^1.7.7",
22
+ "axios": "^1.7.9",
23
23
  "meilisearch": "^0.42.0",
24
24
  "ufo": "^1.5.4",
25
25
  "zod": "^3.23.8"
26
26
  },
27
27
  "peerDependencies": {
28
- "@blocklet/sdk": "^1.16.33"
28
+ "@blocklet/sdk": "1.16.34-beta-20241204-140321-4d75ca21"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "unbuild",