@blocklet/search-kit-js 0.5.22 → 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 +4 -5
- package/dist/index.mjs +3 -4
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
26
|
+
const response = await componentApi__default.request({
|
|
28
27
|
url,
|
|
29
28
|
data: body,
|
|
30
|
-
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
|
|
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
|
|
20
|
+
const response = await componentApi.request({
|
|
22
21
|
url,
|
|
23
22
|
data: body,
|
|
24
|
-
headers
|
|
23
|
+
headers,
|
|
25
24
|
method: opts?.method?.toLocaleUpperCase() ?? "GET"
|
|
26
25
|
});
|
|
27
26
|
return response.data;
|