@go-avro/avro-js 0.0.119 → 0.1.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.
@@ -661,11 +661,6 @@ declare module '../client/QueryClient' {
661
661
  }>>;
662
662
  }
663
663
  }
664
- export type ListQueryMatch = 'match' | 'nomatch' | 'unknown';
665
- export declare function matchesEventsListQuery(queryKey: readonly unknown[], item: any): ListQueryMatch;
666
- export declare function matchesBillsListQuery(queryKey: readonly unknown[], item: any): ListQueryMatch;
667
- export declare function matchesJobsListQuery(queryKey: readonly unknown[], item: any): ListQueryMatch;
668
- export declare function matchesRoutesListQuery(queryKey: readonly unknown[], _item: any): ListQueryMatch;
669
664
  export declare class AvroQueryClient {
670
665
  protected config: Required<Omit<AvroQueryClientConfig, 'clientId' | 'clientVersion' | 'device'>> & Pick<AvroQueryClientConfig, 'clientId' | 'clientVersion' | 'device'>;
671
666
  readonly socket: Socket;
@@ -675,6 +670,8 @@ export declare class AvroQueryClient {
675
670
  private authStateListeners;
676
671
  private _queryClient;
677
672
  private _socketInvalidationCleanup;
673
+ private _applier;
674
+ private _companyVersions;
678
675
  private _emailTracking;
679
676
  private _emailListenersInit;
680
677
  constructor(config: AvroQueryClientConfig);
@@ -689,21 +686,12 @@ export declare class AvroQueryClient {
689
686
  emit(eventName: string, data: unknown): void;
690
687
  on<T>(eventName: string, callback: (data: T) => void): void;
691
688
  off(eventName: string, callback?: Function): void;
692
- /**
693
- * Wire up automatic query invalidation for socket events.
694
- * Called once from AvroQueryClientProvider when the tanstack
695
- * QueryClient is available. Also handles auto-joining the
696
- * company room on connect so consumer apps don't have to.
697
- *
698
- * Targeted events (single-entity CRUD) receive `{ id }` from the
699
- * backend and surgically create / update / remove only the
700
- * affected cache entries. Bulk events fall back to full
701
- * query-key invalidation.
702
- *
703
- * Backward-compatible: if a targeted event arrives without an id
704
- * (old backend), we fall back to full invalidation.
705
- */
689
+ /** Wire the socket to the cache (called once from the provider). */
706
690
  setupSocketInvalidation(queryClient: QueryClient): void;
691
+ /** Join the company room; resync if the ack version moved while away. */
692
+ private joinCompanyRoom;
693
+ /** Fallback for mutations when the socket is down (else the echo syncs). */
694
+ syncAfterMutation(...types: string[]): void;
707
695
  /**
708
696
  * Remove all invalidation listeners. Called on provider unmount.
709
697
  */
@@ -783,24 +771,6 @@ export declare class AvroQueryClient {
783
771
  getQueryClient(): QueryClient;
784
772
  attachQueryClient(queryClient: QueryClient): void;
785
773
  peekQueryClient(): QueryClient | null;
786
- /**
787
- * Bulk-refresh a known set of jobs after a route/scheduling change:
788
- * one request for exactly those ids (`unknown_ids` = "only these
789
- * ids", serialized server-side with this user's own permissions),
790
- * then patch the fresh items into every cached jobs query in place.
791
- * Route-filtered lists are invalidated instead — membership may have
792
- * changed and an in-place patch can't insert newly-assigned jobs.
793
- * Falls back to full jobs invalidation if the fetch fails.
794
- */
795
- _patchJobsByIds(queryClient: QueryClient, jobIds: string[]): Promise<void>;
796
- _syncEntity(queryClient: QueryClient, params: {
797
- action: 'create' | 'update' | 'delete';
798
- entityKey: string;
799
- id: string;
800
- fetchPath?: string;
801
- construct?: (raw: any) => any;
802
- matchesQuery?: (queryKey: readonly unknown[], item: any) => ListQueryMatch;
803
- }): Promise<any>;
804
774
  /**
805
775
  * Drop all local auth state without a server round-trip: stored
806
776
  * tokens, cached company, query cache, socket, and auth state.