@codingfactory/messenger-client 0.2.7 → 0.2.8

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,6 +1,7 @@
1
1
  import type { Message, ReactionSummary } from '../stores/messaging';
2
2
  import type { TypingSubscriptionCallbacks } from '../types/typing';
3
3
  export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'error';
4
+ export type MessagingAccessState = 'available' | 'account_suspended';
4
5
  export interface EchoChannel {
5
6
  listen(event: string, callback: (payload: unknown) => void): unknown;
6
7
  stopListening?(event: string, callback?: (payload: unknown) => void): unknown;
@@ -78,7 +79,9 @@ export interface EchoRuntimeConfig {
78
79
  initializedEvent?: string;
79
80
  getEcho?: () => EchoClient | null;
80
81
  getConnectionStatus?: () => ConnectionStatus;
82
+ getAccessState?: () => MessagingAccessState;
81
83
  onConnectionStatusChange?: (callback: (status: ConnectionStatus) => void) => () => void;
84
+ onAccessStateChange?: (callback: (state: MessagingAccessState) => void) => () => void;
82
85
  reconnect?: () => Promise<void>;
83
86
  subscribeToPresenceStatus?: (callback: (event: PresenceStatusChangedEvent) => void) => void;
84
87
  unsubscribeFromPresenceStatus?: () => void;
@@ -91,7 +94,9 @@ export declare const getEchoInitializedEvent: () => string;
91
94
  export declare const getEcho: () => EchoClient | null;
92
95
  export declare const getEchoConnectionStatus: () => ConnectionStatus;
93
96
  export declare const getConnectionStatus: () => ConnectionStatus;
97
+ export declare const getMessagingAccessState: () => MessagingAccessState;
94
98
  export declare const onConnectionStatusChange: (callback: (status: ConnectionStatus) => void) => (() => void);
99
+ export declare const onMessagingAccessStateChange: (callback: (state: MessagingAccessState) => void) => (() => void);
95
100
  export declare const reconnectEcho: () => Promise<void>;
96
101
  export declare const subscribeToPresenceStatus: (callback: (event: PresenceStatusChangedEvent) => void) => void;
97
102
  export declare const unsubscribeFromPresenceStatus: () => void;
@@ -1,5 +1,5 @@
1
1
  import type { MessagingHttpClient } from './auth';
2
- import type { ConnectionStatus, EchoClient, EchoRuntimeConfig } from './echo';
2
+ import type { ConnectionStatus, EchoClient, EchoRuntimeConfig, MessagingAccessState } from './echo';
3
3
  import { type CreateLogger } from '../utils/logger';
4
4
  export interface MessengerBootstrapPayload {
5
5
  auth: {
@@ -42,6 +42,7 @@ export interface MessengerEchoRuntime extends EchoRuntimeConfig {
42
42
  apiClient: MessagingHttpClient;
43
43
  getEcho(): EchoClient | null;
44
44
  getConnectionStatus(): ConnectionStatus;
45
+ getAccessState(): MessagingAccessState;
45
46
  reconnect(): Promise<void>;
46
47
  clearRuntime(): void;
47
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingfactory/messenger-client",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Shared messaging frontend state, API helpers, and realtime composables.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",