@whitewall/blip-warehouse 0.0.7 → 0.0.9

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,2 +1,2 @@
1
1
  export { BlipWarehouseClient } from './client';
2
- export type { ContactsCountResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, IndexedContact, IndexedMessage, MessageRow, MessagesByIdentityResult, PaginationCursor, SearchRequest, SearchResult, } from './types';
2
+ export type { ContactsCountResponse, GetMessagesOptions, HistoricalIngestProgressEvent, HistoricalIngestRequest, HistoricalIngestResponse, IndexedContact, IndexedMessage, MessagesByIdentityResult, PaginationCursor, SearchRequest, SearchResult, } from './types';
@@ -1,4 +1,4 @@
1
- export type { IndexedContact, IndexedMessage, MessageRow, MessagesByIdentityResult, PaginationCursor, SearchResult, } from '../../src/warehouse/types.js';
1
+ export type { IndexedContact, IndexedMessage, MessagesByIdentityResult, PaginationCursor, SearchResult, } from '../../src/warehouse/types.js';
2
2
  import type { PaginationCursor } from '../../src/warehouse/types.js';
3
3
  export interface ContactsCountResponse {
4
4
  count: number;
@@ -1,4 +1,2 @@
1
1
  import z from 'zod';
2
- export declare const cursorSchema: z.ZodObject<{
3
- page: z.ZodString;
4
- }, z.core.$strip>;
2
+ export declare const cursorSchema: z.ZodString;
@@ -1,14 +1,11 @@
1
1
  import type { Contact, UnknownMessage } from '@whitewall/blip-sdk';
2
2
  import type z from 'zod';
3
3
  import type { cursorSchema } from './schemas.ts';
4
- type Nullable<T> = {
5
- [K in keyof T]: T[K] | null;
6
- };
7
4
  export type IndexedMessage = UnknownMessage & {
8
5
  botIdentifier: string;
9
6
  created: string;
10
7
  };
11
- export type IndexedContact = Nullable<NonNullable<Omit<Contact, 'source' | 'group' | 'city'>>> & {
8
+ export type IndexedContact = Omit<Contact, 'source' | 'group' | 'city'> & {
12
9
  botIdentifier: string;
13
10
  created: string;
14
11
  };
@@ -17,29 +14,22 @@ export type SearchResultTypes = {
17
14
  messages: IndexedMessage;
18
15
  };
19
16
  export type PaginationCursor = z.infer<typeof cursorSchema>;
17
+ export type SearchResultItem = {
18
+ index: 'contacts';
19
+ data: IndexedContact;
20
+ } | {
21
+ index: 'messages';
22
+ data: IndexedMessage;
23
+ };
20
24
  export type SearchResult = {
21
- items: Array<{
22
- index: keyof SearchResultTypes;
23
- data: SearchResultTypes[keyof SearchResultTypes];
24
- }>;
25
+ items: Array<SearchResultItem>;
25
26
  cursor?: PaginationCursor;
26
27
  };
27
28
  export type SearchParams = {
28
29
  limit: number;
29
30
  cursor?: PaginationCursor;
30
31
  };
31
- export type MessageRow = {
32
- id: string;
33
- type: string;
34
- from: string;
35
- to: string;
36
- content: string;
37
- metadata: Record<string, unknown> | null;
38
- botIdentifier: string;
39
- created: string;
40
- };
41
32
  export type MessagesByIdentityResult = {
42
- items: Array<MessageRow>;
33
+ items: Array<IndexedMessage>;
43
34
  cursor?: PaginationCursor;
44
35
  };
45
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitewall/blip-warehouse",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "exports": {
5
5
  "import": "./dist/esm/index.js",
6
6
  "require": "./dist/cjs/index.js",