@synnaxlabs/client 0.15.2 → 0.15.3

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,16 +1,16 @@
1
1
 
2
- > @synnaxlabs/client@0.15.2 build /home/runner/work/synnax/synnax/client/ts
2
+ > @synnaxlabs/client@0.15.3 build /home/runner/work/synnax/synnax/client/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
  vite v5.1.2 building for production...
6
6
  transforming...
7
- ✓ 102 modules transformed.
7
+ ✓ 103 modules transformed.
8
8
  rendering chunks...
9
9
  
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/client.es.js 515.35 kB │ gzip: 113.44 kB │ map: 1,266.74 kB
13
- [vite:dts] Declaration files built in 3637ms.
12
+ dist/client.es.js 521.17 kB │ gzip: 114.65 kB │ map: 1,285.87 kB
13
+ [vite:dts] Declaration files built in 3563ms.
14
14
  
15
- dist/client.cjs.js 343.10 kB │ gzip: 90.56 kB │ map: 1,212.89 kB
16
- ✓ built in 5.22s
15
+ dist/client.cjs.js 347.31 kB │ gzip: 91.63 kB │ map: 1,231.44 kB
16
+ ✓ built in 5.10s
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ import { type Creator } from './creator';
3
3
  import { type Key, type KeyOrName, type Params, type Payload, type NewPayload } from './payload';
4
4
  import { type Retriever } from './retriever';
5
5
  import { type framer } from '../framer';
6
+ import { UnaryClient } from "@synnaxlabs/freighter";
6
7
  /**
7
8
  * Represents a Channel in a Synnax database. It should not be instantiated
8
9
  * directly, but rather created or retrieved from a {@link Client}.
@@ -47,7 +48,8 @@ export declare class Client implements AsyncTermSearcher<string, Key, Channel> {
47
48
  private readonly frameClient;
48
49
  private readonly retriever;
49
50
  private readonly creator;
50
- constructor(segmentClient: framer.Client, retriever: Retriever, creator: Creator);
51
+ private readonly client;
52
+ constructor(segmentClient: framer.Client, retriever: Retriever, client: UnaryClient, creator: Creator);
51
53
  create(channel: NewPayload): Promise<Channel>;
52
54
  create(channels: NewPayload[]): Promise<Channel[]>;
53
55
  retrieve(channel: KeyOrName, rangeKey?: string): Promise<Channel>;
@@ -55,5 +57,6 @@ export declare class Client implements AsyncTermSearcher<string, Key, Channel> {
55
57
  search(term: string, rangeKey?: string): Promise<Channel[]>;
56
58
  newSearcherUnderRange(rangeKey?: string): AsyncTermSearcher<string, Key, Channel>;
57
59
  page(offset: number, limit: number, rangeKey?: string): Promise<Channel[]>;
60
+ createDebouncedBatchRetriever(deb?: number): Retriever;
58
61
  private sugar;
59
62
  }
@@ -47,3 +47,18 @@ export type ParamAnalysisResult = {
47
47
  actual: Names;
48
48
  };
49
49
  export declare const analyzeParams: (channels: Params) => ParamAnalysisResult;
50
+ export interface PromiseFns<T> {
51
+ resolve: (value: T) => void;
52
+ reject: (reason?: any) => void;
53
+ }
54
+ export declare class DebouncedBatchRetriever implements Retriever {
55
+ private readonly mu;
56
+ private readonly requests;
57
+ private readonly wrapped;
58
+ private readonly debouncedRun;
59
+ constructor(wrapped: Retriever, deb: number);
60
+ search(term: string, rangeKey?: string): Promise<Payload[]>;
61
+ page(offset: number, limit: number, rangeKey?: string): Promise<Payload[]>;
62
+ retrieve(channels: Params): Promise<Payload[]>;
63
+ run(): Promise<void>;
64
+ }