@blocklet/search-kit-js 0.2.6

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 ADDED
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ const meilisearch = require('meilisearch');
4
+ const component = require('@blocklet/sdk/lib/component');
5
+
6
+ const SEARCH_KIT_DID = "z8iZorY6mvb5tZrxXTqhBmwu89xjEEazrgT3t";
7
+ class SearchKitClient extends meilisearch.MeiliSearch {
8
+ constructor(config) {
9
+ const endpoint = component.getComponentWebEndpoint(SEARCH_KIT_DID);
10
+ if (!endpoint)
11
+ throw new Error("SearchKit Kit not found");
12
+ super({ host: `${endpoint}/api/meilisearch`, ...config });
13
+ }
14
+ }
15
+
16
+ exports.SearchKitClient = SearchKitClient;
17
+ Object.keys(meilisearch).forEach(function (k) {
18
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = meilisearch[k];
19
+ });
@@ -0,0 +1,8 @@
1
+ import { MeiliSearch, Config } from 'meilisearch';
2
+ export * from 'meilisearch';
3
+
4
+ declare class SearchKitClient extends MeiliSearch {
5
+ constructor(config: Omit<Config, 'host' | 'apiKey'>);
6
+ }
7
+
8
+ export { SearchKitClient };
@@ -0,0 +1,8 @@
1
+ import { MeiliSearch, Config } from 'meilisearch';
2
+ export * from 'meilisearch';
3
+
4
+ declare class SearchKitClient extends MeiliSearch {
5
+ constructor(config: Omit<Config, 'host' | 'apiKey'>);
6
+ }
7
+
8
+ export { SearchKitClient };
@@ -0,0 +1,8 @@
1
+ import { MeiliSearch, Config } from 'meilisearch';
2
+ export * from 'meilisearch';
3
+
4
+ declare class SearchKitClient extends MeiliSearch {
5
+ constructor(config: Omit<Config, 'host' | 'apiKey'>);
6
+ }
7
+
8
+ export { SearchKitClient };
package/dist/index.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import { MeiliSearch } from 'meilisearch';
2
+ export * from 'meilisearch';
3
+ import { getComponentWebEndpoint } from '@blocklet/sdk/lib/component';
4
+
5
+ const SEARCH_KIT_DID = "z8iZorY6mvb5tZrxXTqhBmwu89xjEEazrgT3t";
6
+ class SearchKitClient extends MeiliSearch {
7
+ constructor(config) {
8
+ const endpoint = getComponentWebEndpoint(SEARCH_KIT_DID);
9
+ if (!endpoint)
10
+ throw new Error("SearchKit Kit not found");
11
+ super({ host: `${endpoint}/api/meilisearch`, ...config });
12
+ }
13
+ }
14
+
15
+ export { SearchKitClient };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@blocklet/search-kit-js",
3
+ "version": "0.2.6",
4
+ "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "LICENSE",
18
+ "package.json",
19
+ "README.md"
20
+ ],
21
+ "dependencies": {
22
+ "@blocklet/sdk": "^1.16.28",
23
+ "meilisearch": "^0.41.0"
24
+ },
25
+ "scripts": {
26
+ "build": "unbuild",
27
+ "build:stub": "unbuild --stub",
28
+ "clean": "rimraf dist"
29
+ }
30
+ }