@whitewall/blip-warehouse 0.0.11 → 0.0.12

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,4 +1,4 @@
1
- import type { CreateTokenRequest, CreateTokenResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, MessagesByIdentityResult, SearchRequest, SearchResult } from './types';
1
+ import type { BlipSearchRequest, BlipSearchResult, CreateTokenRequest, CreateTokenResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, MessagesByIdentityResult, SearchRequest, SearchResult } from './types';
2
2
  export declare class BlipWarehouseClient {
3
3
  private readonly baseUrl;
4
4
  private readonly token;
@@ -9,6 +9,7 @@ export declare class BlipWarehouseClient {
9
9
  getContactsCount(): Promise<number>;
10
10
  search(request: SearchRequest): Promise<SearchResult>;
11
11
  getMessagesByIdentity(identity: string, options?: GetMessagesOptions): Promise<MessagesByIdentityResult>;
12
+ blipSearch(request: BlipSearchRequest): Promise<BlipSearchResult>;
12
13
  createToken(request: CreateTokenRequest): Promise<CreateTokenResponse>;
13
14
  historicalIngest(request: HistoricalIngestRequest, onProgress?: (event: HistoricalIngestProgressEvent) => void): Promise<HistoricalIngestResponse>;
14
15
  private request;
@@ -1,2 +1,2 @@
1
1
  export { BlipWarehouseClient } from './client';
2
- export type { ContactsCountResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, IndexedContact, IndexedMessage, MessagesByIdentityResult, PaginationCursor, SearchRequest, SearchResult, } from './types';
2
+ export type { BlipSearchItem, BlipSearchRequest, BlipSearchResult, ContactsCountResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, IndexedContact, IndexedMessage, MessagesByIdentityResult, PaginationCursor, SearchRequest, SearchResult, } from './types';
@@ -1,4 +1,5 @@
1
1
  export type { IndexedContact, IndexedMessage, MessagesByIdentityResult, PaginationCursor, SearchResult, } from '../../src/warehouse/types.js';
2
+ import type { Contact } from '@whitewall/blip-sdk';
2
3
  import type { PaginationCursor } from '../../src/warehouse/types.js';
3
4
  export interface ContactsCountResponse {
4
5
  count: number;
@@ -33,3 +34,22 @@ export interface HistoricalIngestProgressEvent {
33
34
  export interface HistoricalIngestResponse {
34
35
  success: boolean;
35
36
  }
37
+ export interface BlipSearchRequest {
38
+ accessKey: string;
39
+ tenantId: string;
40
+ query?: string;
41
+ tags?: Array<string>;
42
+ limit?: number;
43
+ cursor?: string;
44
+ }
45
+ export type BlipSearchItem = Contact & {
46
+ messageSnippet?: {
47
+ content: string;
48
+ direction: 'sent' | 'received';
49
+ created: string;
50
+ };
51
+ };
52
+ export interface BlipSearchResult {
53
+ items: Array<BlipSearchItem>;
54
+ cursor?: string;
55
+ }
package/dist/cjs/index.js CHANGED
@@ -28,6 +28,12 @@ var BlipWarehouseClient = class {
28
28
  const path = `/warehouse/contacts/${encodeURIComponent(identity)}/messages${queryString ? `?${queryString}` : ""}`;
29
29
  return this.request(path);
30
30
  }
31
+ async blipSearch(request) {
32
+ return this.request("/blip/search", {
33
+ method: "POST",
34
+ body: JSON.stringify(request)
35
+ });
36
+ }
31
37
  async createToken(request) {
32
38
  return this.request("/auth/tokens", {
33
39
  method: "POST",
package/dist/esm/index.js CHANGED
@@ -27,6 +27,12 @@ var BlipWarehouseClient = class {
27
27
  const path = `/warehouse/contacts/${encodeURIComponent(identity)}/messages${queryString ? `?${queryString}` : ""}`;
28
28
  return this.request(path);
29
29
  }
30
+ async blipSearch(request) {
31
+ return this.request("/blip/search", {
32
+ method: "POST",
33
+ body: JSON.stringify(request)
34
+ });
35
+ }
30
36
  async createToken(request) {
31
37
  return this.request("/auth/tokens", {
32
38
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitewall/blip-warehouse",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "exports": {
5
5
  "import": "./dist/esm/index.js",
6
6
  "require": "./dist/cjs/index.js",