@blocklet/search-kit-js 0.5.23 → 0.5.24

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
@@ -2,15 +2,14 @@
2
2
 
3
3
  const meilisearch = require('meilisearch');
4
4
  const component = require('@blocklet/sdk/lib/component');
5
- const verifySign = require('@blocklet/sdk/lib/util/verify-sign');
6
- const axios = require('axios');
5
+ const componentApi = require('@blocklet/sdk/lib/util/component-api');
7
6
  const ufo = require('ufo');
8
7
  const env = require('@blocklet/sdk/lib/env');
9
8
  const crypto = require('crypto');
10
9
 
11
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
12
11
 
13
- const axios__default = /*#__PURE__*/_interopDefaultCompat(axios);
12
+ const componentApi__default = /*#__PURE__*/_interopDefaultCompat(componentApi);
14
13
  const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto);
15
14
 
16
15
  const SEARCH_KIT_DID = "z8iZorY6mvb5tZrxXTqhBmwu89xjEEazrgT3t";
@@ -24,10 +23,10 @@ class SearchKitClient extends meilisearch.MeiliSearch {
24
23
  httpClient: async (url, opts) => {
25
24
  const body = typeof opts?.body === "string" ? JSON.parse(opts.body) : opts?.body ?? {};
26
25
  const headers = typeof opts?.headers === "string" ? JSON.parse(opts.headers) : opts?.headers ?? {};
27
- const response = await axios__default.request({
26
+ const response = await componentApi__default.request({
28
27
  url,
29
28
  data: body,
30
- headers: { "x-component-sig": await verifySign.sign(body), ...headers },
29
+ headers,
31
30
  method: opts?.method?.toLocaleUpperCase() ?? "GET"
32
31
  });
33
32
  return response.data;
package/dist/index.mjs CHANGED
@@ -1,8 +1,7 @@
1
1
  import { MeiliSearch } from 'meilisearch';
2
2
  export * from 'meilisearch';
3
3
  import { getComponentWebEndpoint, getComponentMountPoint } from '@blocklet/sdk/lib/component';
4
- import { sign } from '@blocklet/sdk/lib/util/verify-sign';
5
- import axios from 'axios';
4
+ import componentApi from '@blocklet/sdk/lib/util/component-api';
6
5
  import { joinURL } from 'ufo';
7
6
  import { env } from '@blocklet/sdk/lib/env';
8
7
  import crypto from 'crypto';
@@ -18,10 +17,10 @@ class SearchKitClient extends MeiliSearch {
18
17
  httpClient: async (url, opts) => {
19
18
  const body = typeof opts?.body === "string" ? JSON.parse(opts.body) : opts?.body ?? {};
20
19
  const headers = typeof opts?.headers === "string" ? JSON.parse(opts.headers) : opts?.headers ?? {};
21
- const response = await axios.request({
20
+ const response = await componentApi.request({
22
21
  url,
23
22
  data: body,
24
- headers: { "x-component-sig": await sign(body), ...headers },
23
+ headers,
25
24
  method: opts?.method?.toLocaleUpperCase() ?? "GET"
26
25
  });
27
26
  return response.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/search-kit-js",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",