@23blocks/block-search 4.2.5 → 4.3.0

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,15 +1,61 @@
1
1
  import type { Transport, PageResult } from '@23blocks/contracts';
2
2
  import type { SearchEntity, EntityTypeSchema, RegisterEntityRequest, UpdateEntityRequest, ListEntitiesParams, CopilotSearchRequest } from '../types/entity.js';
3
3
  export interface EntitiesService {
4
+ /**
5
+ * List search entities with optional filtering, pagination, and sorting.
6
+ * @param params - Optional filtering, pagination, and sorting parameters.
7
+ * @returns A paginated result containing an array of {@link SearchEntity} items and pagination metadata.
8
+ * @note The `perPage` param is sent as `records` to the backend API.
9
+ * @note Sort order is expressed via a `-` prefix on the field name for descending (JSON:API convention).
10
+ */
4
11
  list(params?: ListEntitiesParams): Promise<PageResult<SearchEntity>>;
12
+ /**
13
+ * Get a single search entity by its unique ID.
14
+ * @param uniqueId - The unique identifier of the entity.
15
+ * @returns The matching {@link SearchEntity}.
16
+ */
5
17
  get(uniqueId: string): Promise<SearchEntity>;
18
+ /**
19
+ * Register a new search entity under a given unique ID.
20
+ * @param uniqueId - The unique identifier to assign to the entity.
21
+ * @param data - The entity registration payload including entityType, alias, description, and optional fields.
22
+ * @returns The newly created {@link SearchEntity} as persisted by the backend.
23
+ * @note The `uniqueId` is part of the URL path (`/entities/{uniqueId}/register/`), not the request body.
24
+ */
6
25
  register(uniqueId: string, data: RegisterEntityRequest): Promise<SearchEntity>;
26
+ /**
27
+ * Update an existing search entity.
28
+ * @param uniqueId - The unique identifier of the entity to update.
29
+ * @param data - The fields to update. All fields are optional.
30
+ * @returns The updated {@link SearchEntity}.
31
+ * @note Uses PUT (not PATCH) for the update request.
32
+ */
7
33
  update(uniqueId: string, data: UpdateEntityRequest): Promise<SearchEntity>;
34
+ /**
35
+ * Delete a search entity by its unique ID.
36
+ * @param uniqueId - The unique identifier of the entity to delete.
37
+ * @returns Resolves with no value on successful deletion.
38
+ */
8
39
  delete(uniqueId: string): Promise<void>;
40
+ /**
41
+ * List all available entity types.
42
+ * @returns An array of objects each containing an `entityType` string.
43
+ * @note Returns an empty array if the backend response is not an array.
44
+ */
9
45
  listEntityTypes(): Promise<{
10
46
  entityType: string;
11
47
  }[]>;
48
+ /**
49
+ * Get the schema definition for a specific entity type.
50
+ * @param entityType - The entity type identifier to retrieve the schema for.
51
+ * @returns The {@link EntityTypeSchema} containing field definitions and metadata for the given type.
52
+ */
12
53
  getEntityTypeSchema(entityType: string): Promise<EntityTypeSchema>;
54
+ /**
55
+ * Search entities using AI copilot-assisted search.
56
+ * @param data - The copilot search request containing a query string, optional entity type filters, and limit.
57
+ * @returns An array of {@link SearchEntity} items matching the copilot query.
58
+ */
13
59
  searchByCopilot(data: CopilotSearchRequest): Promise<SearchEntity[]>;
14
60
  }
15
61
  export declare function createEntitiesService(transport: Transport, _config: {
@@ -1 +1 @@
1
- {"version":3,"file":"entities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/entities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/E,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,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AAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IAErD;;;;OAIG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEnE;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CACtE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CA8EvG"}
@@ -1,9 +1,35 @@
1
1
  import type { Transport, PageResult } from '@23blocks/contracts';
2
2
  import type { SearchIdentity, RegisterIdentityRequest, UpdateIdentityRequest, ListIdentitiesParams } from '../types/identity.js';
3
3
  export interface IdentitiesService {
4
+ /**
5
+ * List search identities with optional filtering, pagination, and sorting.
6
+ * @param params - Optional filtering, pagination, and sorting parameters.
7
+ * @returns A paginated result containing an array of {@link SearchIdentity} items and pagination metadata.
8
+ * @note The `perPage` param is sent as `records` to the backend API.
9
+ * @note Sort order is expressed via a `-` prefix on the field name for descending (JSON:API convention).
10
+ */
4
11
  list(params?: ListIdentitiesParams): Promise<PageResult<SearchIdentity>>;
12
+ /**
13
+ * Get a single search identity by its unique ID.
14
+ * @param uniqueId - The unique identifier of the identity.
15
+ * @returns The matching {@link SearchIdentity}.
16
+ */
5
17
  get(uniqueId: string): Promise<SearchIdentity>;
18
+ /**
19
+ * Register a new search identity under a given unique ID.
20
+ * @param uniqueId - The unique identifier to assign to the identity.
21
+ * @param data - The identity registration payload including email, name fields, and optional avatar/payload.
22
+ * @returns The newly created {@link SearchIdentity} as persisted by the backend.
23
+ * @note The `uniqueId` is part of the URL path (`/identities/{uniqueId}/register/`), not the request body.
24
+ */
6
25
  register(uniqueId: string, data: RegisterIdentityRequest): Promise<SearchIdentity>;
26
+ /**
27
+ * Update an existing search identity.
28
+ * @param uniqueId - The unique identifier of the identity to update.
29
+ * @param data - The fields to update. All fields are optional.
30
+ * @returns The updated {@link SearchIdentity}.
31
+ * @note Uses PUT (not PATCH) for the update request.
32
+ */
7
33
  update(uniqueId: string, data: UpdateIdentityRequest): Promise<SearchIdentity>;
8
34
  }
9
35
  export declare function createIdentitiesService(transport: Transport, _config: {
@@ -1 +1 @@
1
- {"version":3,"file":"identities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/identities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IACzE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACnF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAChF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAgD3G"}
1
+ {"version":3,"file":"identities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/identities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAEzE;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/C;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEnF;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAChF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAgD3G"}
@@ -28,15 +28,26 @@ export interface JarvisSearchResult extends SearchResult {
28
28
  */
29
29
  export interface JarvisSearchService {
30
30
  /**
31
- * Search entities using Jarvis AI-enhanced search
31
+ * Search entities using Jarvis AI-enhanced search.
32
+ * @param query - The search query including filters, sorting, pagination, and optional metadata/relation inclusion flags.
33
+ * @returns A paginated result containing an array of {@link JarvisSearchResult} items (with AI-enhanced fields like confidence and relevanceScore) and pagination metadata.
32
34
  */
33
35
  search(query: JarvisSearchQuery): Promise<PageResult<JarvisSearchResult>>;
34
36
  /**
35
- * Get semantic suggestions based on query
37
+ * Get semantic suggestions based on a query string.
38
+ * @param query - The text to generate suggestions for.
39
+ * @param limit - Optional maximum number of suggestions to return.
40
+ * @returns An array of suggestion strings.
41
+ * @note Returns an empty array if the backend response contains no suggestions.
36
42
  */
37
43
  suggest(query: string, limit?: number): Promise<string[]>;
38
44
  /**
39
- * Get related entities based on an entity
45
+ * Get related entities based on a source entity.
46
+ * @param entityUniqueId - The unique identifier of the source entity to find relations for.
47
+ * @param entityType - The type of the source entity.
48
+ * @param limit - Optional maximum number of related entities to return.
49
+ * @returns An array of {@link JarvisSearchResult} items related to the source entity.
50
+ * @note The response data is mapped individually rather than decoded as a JSON:API collection.
40
51
  */
41
52
  getRelated(entityUniqueId: string, entityType: string, limit?: number): Promise<JarvisSearchResult[]>;
42
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jarvis-search.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/jarvis-search.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE1E;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE1D;;OAEG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CACvG;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACzB,mBAAmB,CAwDrB"}
1
+ {"version":3,"file":"jarvis-search.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/jarvis-search.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE1E;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CACvG;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACzB,mBAAmB,CAwDrB"}
@@ -6,15 +6,22 @@ import type { SearchBlockConfig } from '../search.block.js';
6
6
  */
7
7
  export interface SearchService {
8
8
  /**
9
- * Execute a search query
9
+ * Execute a search query against the search index.
10
+ * @param request - The search request containing query text, optional entity type filters, include/exclude lists, and pagination (limit/offset).
11
+ * @returns A {@link SearchResponse} containing the matched results array, a synthesized {@link SearchQuery} with execution metadata (elapsed time, total records), and summary counts.
12
+ * @note The returned `query` object is constructed from response metadata when available; otherwise it is synthesized client-side with default/null values.
10
13
  */
11
14
  search(request: SearchRequest): Promise<SearchResponse>;
12
15
  /**
13
- * Get search suggestions/autocomplete
16
+ * Get search suggestions/autocomplete results for a partial query.
17
+ * @param query - The partial text to generate suggestions for.
18
+ * @param limit - Maximum number of suggestions to return. Defaults to 10.
19
+ * @returns An array of {@link SearchResult} items matching the suggestion query.
14
20
  */
15
21
  suggest(query: string, limit?: number): Promise<SearchResult[]>;
16
22
  /**
17
- * Get available entity types
23
+ * Get all available entity types that can be searched.
24
+ * @returns An array of {@link EntityType} objects, each containing the type identifier and source.
18
25
  */
19
26
  entityTypes(): Promise<EntityType[]>;
20
27
  }
@@ -23,19 +30,27 @@ export interface SearchService {
23
30
  */
24
31
  export interface SearchHistoryService {
25
32
  /**
26
- * Get recent searches for the current user
33
+ * Get recent searches for the current user.
34
+ * @param limit - Maximum number of recent queries to return. Defaults to 20.
35
+ * @returns An array of {@link LastQuery} objects representing the user's recent search history, including query text, user context, and execution statistics.
27
36
  */
28
37
  recent(limit?: number): Promise<LastQuery[]>;
29
38
  /**
30
- * Get a specific query by unique ID
39
+ * Get a specific saved query by its unique ID.
40
+ * @param uniqueId - The unique identifier of the query to retrieve.
41
+ * @returns The full {@link SearchQuery} record including query text, user context, execution timing, and result counts.
31
42
  */
32
43
  get(uniqueId: string): Promise<SearchQuery>;
33
44
  /**
34
- * Clear search history
45
+ * Clear all search history for the current user.
46
+ * @returns Resolves with no value on successful deletion.
47
+ * @note This deletes the entire search history; individual entries cannot be restored after clearing.
35
48
  */
36
49
  clear(): Promise<void>;
37
50
  /**
38
- * Delete a specific query from history
51
+ * Delete a specific query from the search history.
52
+ * @param uniqueId - The unique identifier of the history entry to delete.
53
+ * @returns Resolves with no value on successful deletion.
39
54
  */
40
55
  delete(uniqueId: string): Promise<void>;
41
56
  }
@@ -44,23 +59,34 @@ export interface SearchHistoryService {
44
59
  */
45
60
  export interface FavoritesService {
46
61
  /**
47
- * List user's favorites
62
+ * List the current user's favorite entities with optional pagination, sorting, and filtering.
63
+ * @param params - Optional {@link ListParams} for pagination, sorting, and filtering.
64
+ * @returns A paginated result containing an array of {@link FavoriteEntity} items and pagination metadata.
48
65
  */
49
66
  list(params?: ListParams): Promise<PageResult<FavoriteEntity>>;
50
67
  /**
51
- * Get a favorite by unique ID
68
+ * Get a single favorite by its unique ID.
69
+ * @param uniqueId - The unique identifier of the favorite entry.
70
+ * @returns The matching {@link FavoriteEntity}.
52
71
  */
53
72
  get(uniqueId: string): Promise<FavoriteEntity>;
54
73
  /**
55
- * Add a favorite
74
+ * Add an entity to the user's favorites.
75
+ * @param request - The favorite request containing the entity's unique ID, type, and optional alias/URL/avatar fields.
76
+ * @returns The newly created {@link FavoriteEntity} as persisted by the backend.
56
77
  */
57
78
  add(request: AddFavoriteRequest): Promise<FavoriteEntity>;
58
79
  /**
59
- * Remove a favorite
80
+ * Remove a favorite by its unique ID.
81
+ * @param uniqueId - The unique identifier of the favorite entry to remove.
82
+ * @returns Resolves with no value on successful removal.
60
83
  */
61
84
  remove(uniqueId: string): Promise<void>;
62
85
  /**
63
- * Check if an entity is favorited
86
+ * Check whether a given entity is in the user's favorites.
87
+ * @param entityUniqueId - The unique identifier of the entity to check.
88
+ * @returns `true` if the entity is favorited, `false` otherwise.
89
+ * @note Returns `false` on any error (e.g., network failure or 404), rather than throwing.
64
90
  */
65
91
  isFavorite(entityUniqueId: string): Promise<boolean>;
66
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"search.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG7E,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAExD;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,E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,EACpB,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,CAyClB"}
1
+ {"version":3,"file":"search.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/search.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG7E,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAExD;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEhE;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAE7C;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5C;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/C;;;;OAIG;IACH,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE1D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;OAKG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD;AAiCD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,GACzB,aAAa,CAwHf;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,GACzB,oBAAoB,CAuBtB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,CAyClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@23blocks/block-search",
3
- "version": "4.2.5",
3
+ "version": "4.3.0",
4
4
  "description": "Search block for 23blocks SDK - full-text search, history, favorites",
5
5
  "license": "MIT",
6
6
  "author": "23blocks <hello@23blocks.com>",