agentbase-web-sdk 1.12.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.
- package/LICENSE +0 -0
- package/README.md +41 -0
- package/dist/cjs/sdk.js +16322 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/sdk.js +16292 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +20121 -0
- package/package.json +54 -0
- package/types/channel.d.ts +79 -0
- package/types/client.d.ts +289 -0
- package/types/enums/authentication-factor.d.ts +6 -0
- package/types/enums/authenticator-type.d.ts +3 -0
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/browser.d.ts +16 -0
- package/types/enums/credit-card.d.ts +19 -0
- package/types/enums/data-api-catalog-data-source-database-type.d.ts +6 -0
- package/types/enums/data-api-catalog-data-source-visibility-source.d.ts +7 -0
- package/types/enums/data-api-catalog-database-availability.d.ts +5 -0
- package/types/enums/data-api-catalog-database-classification.d.ts +4 -0
- package/types/enums/data-api-catalog-database-status.d.ts +4 -0
- package/types/enums/data-api-catalog-database-visibility-source.d.ts +7 -0
- package/types/enums/data-api-filter-logic.d.ts +4 -0
- package/types/enums/data-api-owned-binding-principal-type.d.ts +4 -0
- package/types/enums/data-api-owned-binding-status.d.ts +4 -0
- package/types/enums/distillation-message-role.d.ts +6 -0
- package/types/enums/distillation-mode.d.ts +4 -0
- package/types/enums/distillation-tool-status.d.ts +4 -0
- package/types/enums/execution-method.d.ts +9 -0
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/export-job-mode.d.ts +4 -0
- package/types/enums/export-mode.d.ts +3 -0
- package/types/enums/feedback-type.d.ts +5 -0
- package/types/enums/flag.d.ts +197 -0
- package/types/enums/format.d.ts +4 -0
- package/types/enums/image-format.d.ts +9 -0
- package/types/enums/image-gravity.d.ts +11 -0
- package/types/enums/kind.d.ts +6 -0
- package/types/enums/kinds.d.ts +6 -0
- package/types/enums/knowledge-base-data-source-document-import-result-status.d.ts +5 -0
- package/types/enums/memory-access-mode.d.ts +4 -0
- package/types/enums/memory-batch-operation.d.ts +5 -0
- package/types/enums/memory-bulk-delete-item-status.d.ts +4 -0
- package/types/enums/memory-bulk-delete-response-status.d.ts +4 -0
- package/types/enums/memory-handling-policy.d.ts +5 -0
- package/types/enums/memory-message-role.d.ts +5 -0
- package/types/enums/memory-pipeline-run-result-status.d.ts +4 -0
- package/types/enums/memory-pipeline-run-scenario.d.ts +6 -0
- package/types/enums/memory-pipeline-run-status.d.ts +6 -0
- package/types/enums/memory-record-kind.d.ts +5 -0
- package/types/enums/memory-record-sensitivity.d.ts +5 -0
- package/types/enums/memory-scope.d.ts +7 -0
- package/types/enums/memory-sensitivity.d.ts +6 -0
- package/types/enums/memory-share-subject-type.d.ts +4 -0
- package/types/enums/method.d.ts +9 -0
- package/types/enums/o-auth-provider.d.ts +45 -0
- package/types/enums/organization-project-deletion-deletion-status.d.ts +5 -0
- package/types/enums/organization-role.d.ts +8 -0
- package/types/enums/organization-usage-range.d.ts +5 -0
- package/types/enums/outcome.d.ts +6 -0
- package/types/enums/path-match.d.ts +4 -0
- package/types/enums/profile-extraction-mode.d.ts +4 -0
- package/types/enums/profile-type.d.ts +4 -0
- package/types/enums/project-deletion-restore-status.d.ts +3 -0
- package/types/enums/project-deletion-result-deletion-status.d.ts +5 -0
- package/types/enums/project-deletion-result-status.d.ts +5 -0
- package/types/enums/record-kind.d.ts +5 -0
- package/types/enums/retention-policy.d.ts +3 -0
- package/types/enums/scenario.d.ts +6 -0
- package/types/enums/scene.d.ts +4 -0
- package/types/enums/scope.d.ts +5 -0
- package/types/enums/source-type.d.ts +6 -0
- package/types/enums/status.d.ts +23 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +422 -0
- package/types/enums/transaction-action.d.ts +12 -0
- package/types/enums/validation-status.d.ts +6 -0
- package/types/enums/verification-source.d.ts +5 -0
- package/types/id.d.ts +20 -0
- package/types/index.d.ts +105 -0
- package/types/models.d.ts +3368 -0
- package/types/operator.d.ts +180 -0
- package/types/permission.d.ts +43 -0
- package/types/query.d.ts +442 -0
- package/types/role.d.ts +70 -0
- package/types/service.d.ts +11 -0
- package/types/services/account.d.ts +1350 -0
- package/types/services/agent-runtime.d.ts +370 -0
- package/types/services/ai-gateway.d.ts +888 -0
- package/types/services/avatars.d.ts +320 -0
- package/types/services/data-api.d.ts +257 -0
- package/types/services/databases.d.ts +441 -0
- package/types/services/documents-db.d.ts +409 -0
- package/types/services/functions.d.ts +175 -0
- package/types/services/graphql.d.ts +43 -0
- package/types/services/knowledge-bases.d.ts +304 -0
- package/types/services/llm-gateway.d.ts +289 -0
- package/types/services/locale.d.ts +64 -0
- package/types/services/memory.d.ts +2352 -0
- package/types/services/messaging.d.ts +53 -0
- package/types/services/projects.d.ts +129 -0
- package/types/services/realtime.d.ts +197 -0
- package/types/services/self-hosted-organizations.d.ts +495 -0
- package/types/services/storage.d.ts +265 -0
- package/types/services/tables-db.d.ts +438 -0
- package/types/services/teams.d.ts +341 -0
- package/types/services/vectors-db.d.ts +297 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class Messaging {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* Create a new subscriber.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} params.topicId - Topic ID. The topic ID to subscribe to.
|
|
10
|
+
* @param {string} params.subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
11
|
+
* @param {string} params.targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
12
|
+
* @throws {AgentbaseException}
|
|
13
|
+
* @returns {Promise<Models.Subscriber>}
|
|
14
|
+
*/
|
|
15
|
+
createSubscriber(params: {
|
|
16
|
+
topicId: string;
|
|
17
|
+
subscriberId: string;
|
|
18
|
+
targetId: string;
|
|
19
|
+
}): Promise<Models.Subscriber>;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new subscriber.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} topicId - Topic ID. The topic ID to subscribe to.
|
|
24
|
+
* @param {string} subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
25
|
+
* @param {string} targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
26
|
+
* @throws {AgentbaseException}
|
|
27
|
+
* @returns {Promise<Models.Subscriber>}
|
|
28
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
29
|
+
*/
|
|
30
|
+
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete a subscriber by its unique ID.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
35
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
36
|
+
* @throws {AgentbaseException}
|
|
37
|
+
* @returns {Promise<{}>}
|
|
38
|
+
*/
|
|
39
|
+
deleteSubscriber(params: {
|
|
40
|
+
topicId: string;
|
|
41
|
+
subscriberId: string;
|
|
42
|
+
}): Promise<{}>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a subscriber by its unique ID.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
47
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
48
|
+
* @throws {AgentbaseException}
|
|
49
|
+
* @returns {Promise<{}>}
|
|
50
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
51
|
+
*/
|
|
52
|
+
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class Projects {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {string} params.projectId - Project ID.
|
|
9
|
+
* @throws {AgentbaseException}
|
|
10
|
+
* @returns {Promise<Models.MeterUsageList>}
|
|
11
|
+
*/
|
|
12
|
+
getUsageAggregates(params: {
|
|
13
|
+
projectId: string;
|
|
14
|
+
}): Promise<Models.MeterUsageList>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {string} projectId - Project ID.
|
|
18
|
+
* @throws {AgentbaseException}
|
|
19
|
+
* @returns {Promise<Models.MeterUsageList>}
|
|
20
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
21
|
+
*/
|
|
22
|
+
getUsageAggregates(projectId: string): Promise<Models.MeterUsageList>;
|
|
23
|
+
/**
|
|
24
|
+
* Schedule projects owned by an organization for deletion after the retention period.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} params.teamId - Organization ID.
|
|
27
|
+
* @param {string[]} params.projectIds - Project IDs to release.
|
|
28
|
+
* @param {boolean} params.dryRun - Validate only without deleting.
|
|
29
|
+
* @param {string} params.reason - Audit reason.
|
|
30
|
+
* @throws {AgentbaseException}
|
|
31
|
+
* @returns {Promise<Models.ProjectBatchDeletion>}
|
|
32
|
+
*/
|
|
33
|
+
batchReleaseByOrganization(params: {
|
|
34
|
+
teamId: string;
|
|
35
|
+
projectIds: string[];
|
|
36
|
+
dryRun?: boolean;
|
|
37
|
+
reason?: string;
|
|
38
|
+
}): Promise<Models.ProjectBatchDeletion>;
|
|
39
|
+
/**
|
|
40
|
+
* Schedule projects owned by an organization for deletion after the retention period.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} teamId - Organization ID.
|
|
43
|
+
* @param {string[]} projectIds - Project IDs to release.
|
|
44
|
+
* @param {boolean} dryRun - Validate only without deleting.
|
|
45
|
+
* @param {string} reason - Audit reason.
|
|
46
|
+
* @throws {AgentbaseException}
|
|
47
|
+
* @returns {Promise<Models.ProjectBatchDeletion>}
|
|
48
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
49
|
+
*/
|
|
50
|
+
batchReleaseByOrganization(teamId: string, projectIds: string[], dryRun?: boolean, reason?: string): Promise<Models.ProjectBatchDeletion>;
|
|
51
|
+
/**
|
|
52
|
+
* List projects in the deletion lifecycle for an organization owned by the caller.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} params.teamId - Organization ID.
|
|
55
|
+
* @param {number} params.limit - Maximum results per page (1-100).
|
|
56
|
+
* @param {number} params.offset - Results offset.
|
|
57
|
+
* @throws {AgentbaseException}
|
|
58
|
+
* @returns {Promise<Models.OrganizationProjectDeletionList>}
|
|
59
|
+
*/
|
|
60
|
+
listDeletionsByOrganization(params: {
|
|
61
|
+
teamId: string;
|
|
62
|
+
limit?: number;
|
|
63
|
+
offset?: number;
|
|
64
|
+
}): Promise<Models.OrganizationProjectDeletionList>;
|
|
65
|
+
/**
|
|
66
|
+
* List projects in the deletion lifecycle for an organization owned by the caller.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} teamId - Organization ID.
|
|
69
|
+
* @param {number} limit - Maximum results per page (1-100).
|
|
70
|
+
* @param {number} offset - Results offset.
|
|
71
|
+
* @throws {AgentbaseException}
|
|
72
|
+
* @returns {Promise<Models.OrganizationProjectDeletionList>}
|
|
73
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
74
|
+
*/
|
|
75
|
+
listDeletionsByOrganization(teamId: string, limit?: number, offset?: number): Promise<Models.OrganizationProjectDeletionList>;
|
|
76
|
+
/**
|
|
77
|
+
* List inactive projects for an organization owned by the caller.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} params.teamId - Organization ID.
|
|
80
|
+
* @param {number} params.inactiveDays - Inactive threshold in days (1-365).
|
|
81
|
+
* @param {number} params.graceDays - Grace period after project creation.
|
|
82
|
+
* @param {number} params.limit - Maximum results per page (1-500).
|
|
83
|
+
* @param {string} params.cursor - Pagination cursor (projectId).
|
|
84
|
+
* @throws {AgentbaseException}
|
|
85
|
+
* @returns {Promise<Models.OrganizationInactiveProjectList>}
|
|
86
|
+
*/
|
|
87
|
+
listInactiveByOrganization(params: {
|
|
88
|
+
teamId: string;
|
|
89
|
+
inactiveDays: number;
|
|
90
|
+
graceDays?: number;
|
|
91
|
+
limit?: number;
|
|
92
|
+
cursor?: string;
|
|
93
|
+
}): Promise<Models.OrganizationInactiveProjectList>;
|
|
94
|
+
/**
|
|
95
|
+
* List inactive projects for an organization owned by the caller.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} teamId - Organization ID.
|
|
98
|
+
* @param {number} inactiveDays - Inactive threshold in days (1-365).
|
|
99
|
+
* @param {number} graceDays - Grace period after project creation.
|
|
100
|
+
* @param {number} limit - Maximum results per page (1-500).
|
|
101
|
+
* @param {string} cursor - Pagination cursor (projectId).
|
|
102
|
+
* @throws {AgentbaseException}
|
|
103
|
+
* @returns {Promise<Models.OrganizationInactiveProjectList>}
|
|
104
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
105
|
+
*/
|
|
106
|
+
listInactiveByOrganization(teamId: string, inactiveDays: number, graceDays?: number, limit?: number, cursor?: string): Promise<Models.OrganizationInactiveProjectList>;
|
|
107
|
+
/**
|
|
108
|
+
* Restore a project owned by an organization while it is pending physical deletion.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} params.teamId - Organization ID.
|
|
111
|
+
* @param {string} params.projectId - Project ID.
|
|
112
|
+
* @throws {AgentbaseException}
|
|
113
|
+
* @returns {Promise<Models.ProjectDeletionRestore>}
|
|
114
|
+
*/
|
|
115
|
+
restoreDeletionByOrganization(params: {
|
|
116
|
+
teamId: string;
|
|
117
|
+
projectId: string;
|
|
118
|
+
}): Promise<Models.ProjectDeletionRestore>;
|
|
119
|
+
/**
|
|
120
|
+
* Restore a project owned by an organization while it is pending physical deletion.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} teamId - Organization ID.
|
|
123
|
+
* @param {string} projectId - Project ID.
|
|
124
|
+
* @throws {AgentbaseException}
|
|
125
|
+
* @returns {Promise<Models.ProjectDeletionRestore>}
|
|
126
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
127
|
+
*/
|
|
128
|
+
restoreDeletionByOrganization(teamId: string, projectId: string): Promise<Models.ProjectDeletionRestore>;
|
|
129
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import { Channel, ActionableChannel, ResolvedChannel } from '../channel';
|
|
3
|
+
import { Query } from '../query';
|
|
4
|
+
export type RealtimeSubscriptionUpdate = {
|
|
5
|
+
channels?: (string | Channel<any> | ActionableChannel | ResolvedChannel)[];
|
|
6
|
+
queries?: (string | Query)[];
|
|
7
|
+
};
|
|
8
|
+
export type RealtimeSubscription = {
|
|
9
|
+
/**
|
|
10
|
+
* Remove this subscription only. Keeps the WebSocket open so other subscriptions keep receiving events.
|
|
11
|
+
* Use `Realtime.disconnect()` to close the connection entirely.
|
|
12
|
+
*/
|
|
13
|
+
unsubscribe: () => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Replace the channels and/or queries for this subscription on the server without re-creating it.
|
|
16
|
+
*/
|
|
17
|
+
update: (changes: RealtimeSubscriptionUpdate) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Alias of `unsubscribe()` plus legacy auto-disconnect when this was the last active subscription.
|
|
20
|
+
* Prefer `unsubscribe()` for per-subscription teardown and `Realtime.disconnect()` for full shutdown.
|
|
21
|
+
*/
|
|
22
|
+
close: () => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export type RealtimeCallback<T = any> = {
|
|
25
|
+
channels: Set<string>;
|
|
26
|
+
queries: string[];
|
|
27
|
+
callback: (event: RealtimeResponseEvent<T>) => void;
|
|
28
|
+
};
|
|
29
|
+
export type RealtimeResponse = {
|
|
30
|
+
type: string;
|
|
31
|
+
data?: any;
|
|
32
|
+
};
|
|
33
|
+
export type RealtimeResponseEvent<T = any> = {
|
|
34
|
+
events: string[];
|
|
35
|
+
channels: string[];
|
|
36
|
+
timestamp: string;
|
|
37
|
+
payload: T;
|
|
38
|
+
subscriptions: string[];
|
|
39
|
+
};
|
|
40
|
+
export type RealtimeResponseConnected = {
|
|
41
|
+
channels: string[];
|
|
42
|
+
user?: object;
|
|
43
|
+
};
|
|
44
|
+
export type RealtimeRequest = {
|
|
45
|
+
type: 'authentication' | 'subscribe' | 'unsubscribe' | 'presence';
|
|
46
|
+
data: any;
|
|
47
|
+
};
|
|
48
|
+
export type RealtimePresence = {
|
|
49
|
+
$id: string;
|
|
50
|
+
$sequence?: string | number;
|
|
51
|
+
$createdAt: string;
|
|
52
|
+
$updatedAt: string;
|
|
53
|
+
$permissions: string[];
|
|
54
|
+
userInternalId: string;
|
|
55
|
+
userId: string;
|
|
56
|
+
status?: string;
|
|
57
|
+
source: string;
|
|
58
|
+
metadata?: Record<string, any>;
|
|
59
|
+
};
|
|
60
|
+
export type RealtimePresenceCreate = {
|
|
61
|
+
status: string;
|
|
62
|
+
presenceId: string;
|
|
63
|
+
permissions?: string[];
|
|
64
|
+
metadata?: Record<string, any>;
|
|
65
|
+
};
|
|
66
|
+
export declare enum RealtimeCode {
|
|
67
|
+
NORMAL_CLOSURE = 1000,
|
|
68
|
+
POLICY_VIOLATION = 1008,
|
|
69
|
+
UNKNOWN_ERROR = -1
|
|
70
|
+
}
|
|
71
|
+
export declare class Realtime {
|
|
72
|
+
private readonly TYPE_ERROR;
|
|
73
|
+
private readonly TYPE_EVENT;
|
|
74
|
+
private readonly TYPE_PONG;
|
|
75
|
+
private readonly TYPE_CONNECTED;
|
|
76
|
+
private readonly DEBOUNCE_MS;
|
|
77
|
+
private readonly HEARTBEAT_INTERVAL;
|
|
78
|
+
private client;
|
|
79
|
+
private socket?;
|
|
80
|
+
private activeSubscriptions;
|
|
81
|
+
private pendingSubscribes;
|
|
82
|
+
private pendingPresence?;
|
|
83
|
+
private appConnected;
|
|
84
|
+
private heartbeatTimer?;
|
|
85
|
+
private socketCreationPromise?;
|
|
86
|
+
private subCallDepth;
|
|
87
|
+
private reconnectAttempts;
|
|
88
|
+
private connectionId;
|
|
89
|
+
private reconnect;
|
|
90
|
+
private onErrorCallbacks;
|
|
91
|
+
private onCloseCallbacks;
|
|
92
|
+
private onOpenCallbacks;
|
|
93
|
+
constructor(client: Client);
|
|
94
|
+
/**
|
|
95
|
+
* Register a callback function to be called when an error occurs
|
|
96
|
+
*
|
|
97
|
+
* @param {Function} callback - Callback function to handle errors
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
onError(callback: (error?: Error, statusCode?: number) => void): void;
|
|
101
|
+
/**
|
|
102
|
+
* Register a callback function to be called when the connection closes
|
|
103
|
+
*
|
|
104
|
+
* @param {Function} callback - Callback function to handle connection close
|
|
105
|
+
* @returns {void}
|
|
106
|
+
*/
|
|
107
|
+
onClose(callback: () => void): void;
|
|
108
|
+
/**
|
|
109
|
+
* Register a callback function to be called when the connection opens
|
|
110
|
+
*
|
|
111
|
+
* @param {Function} callback - Callback function to handle connection open
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
onOpen(callback: () => void): void;
|
|
115
|
+
private startHeartbeat;
|
|
116
|
+
private stopHeartbeat;
|
|
117
|
+
/**
|
|
118
|
+
* Idempotent socket opener. Both `subscribe()` and `upsertPresence()` can
|
|
119
|
+
* call this; the single-flight lock (`socketCreationPromise`) guarantees
|
|
120
|
+
* only one `new WebSocket(...)` is ever in flight, so concurrent callers
|
|
121
|
+
* join the same connection attempt instead of opening duplicates.
|
|
122
|
+
*
|
|
123
|
+
* Returns early when a healthy socket is already present.
|
|
124
|
+
*/
|
|
125
|
+
private createSocket;
|
|
126
|
+
private createSocketLocked;
|
|
127
|
+
private closeSocket;
|
|
128
|
+
private getTimeout;
|
|
129
|
+
private sleep;
|
|
130
|
+
private sendUnsubscribeMessage;
|
|
131
|
+
private generateUniqueSubscriptionId;
|
|
132
|
+
private enqueuePendingSubscribe;
|
|
133
|
+
/**
|
|
134
|
+
* Close the WebSocket connection and drop all active subscriptions client-side.
|
|
135
|
+
* Use this instead of calling `unsubscribe()` on every subscription when you want to tear everything down.
|
|
136
|
+
*/
|
|
137
|
+
disconnect(): Promise<void>;
|
|
138
|
+
private sendPendingSubscribes;
|
|
139
|
+
/**
|
|
140
|
+
* Convert a channel value to a string
|
|
141
|
+
*
|
|
142
|
+
* @private
|
|
143
|
+
* @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel value (string or Channel builder instance)
|
|
144
|
+
* @returns {string} Channel string representation
|
|
145
|
+
*/
|
|
146
|
+
private channelToString;
|
|
147
|
+
/**
|
|
148
|
+
* Subscribe to a single channel
|
|
149
|
+
*
|
|
150
|
+
* @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel name to subscribe to (string or Channel builder instance)
|
|
151
|
+
* @param {Function} callback - Callback function to handle events
|
|
152
|
+
* @returns {Promise<RealtimeSubscription>} Subscription object with close method
|
|
153
|
+
*/
|
|
154
|
+
subscribe(channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<any>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
|
|
155
|
+
/**
|
|
156
|
+
* Subscribe to multiple channels
|
|
157
|
+
*
|
|
158
|
+
* @param {(string | Channel<any> | ActionableChannel | ResolvedChannel)[]} channels - Array of channel names to subscribe to (strings or Channel builder instances)
|
|
159
|
+
* @param {Function} callback - Callback function to handle events
|
|
160
|
+
* @returns {Promise<RealtimeSubscription>} Subscription object with close method
|
|
161
|
+
*/
|
|
162
|
+
subscribe(channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<any>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
|
|
163
|
+
/**
|
|
164
|
+
* Subscribe to a single channel with typed payload
|
|
165
|
+
*
|
|
166
|
+
* @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel name to subscribe to (string or Channel builder instance)
|
|
167
|
+
* @param {Function} callback - Callback function to handle events with typed payload
|
|
168
|
+
* @returns {Promise<RealtimeSubscription>} Subscription object with close method
|
|
169
|
+
*/
|
|
170
|
+
subscribe<T>(channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<T>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
|
|
171
|
+
/**
|
|
172
|
+
* Subscribe to multiple channels with typed payload
|
|
173
|
+
*
|
|
174
|
+
* @param {(string | Channel<any> | ActionableChannel | ResolvedChannel)[]} channels - Array of channel names to subscribe to (strings or Channel builder instances)
|
|
175
|
+
* @param {Function} callback - Callback function to handle events with typed payload
|
|
176
|
+
* @returns {Promise<RealtimeSubscription>} Subscription object with close method
|
|
177
|
+
*/
|
|
178
|
+
subscribe<T>(channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<T>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
|
|
179
|
+
/**
|
|
180
|
+
* Fire-and-forget presence upsert. Records the latest payload in state so
|
|
181
|
+
* that — if the WebSocket isn't open yet, or later reconnects — only the
|
|
182
|
+
* most recent presence is automatically (re)sent on the next `connected`
|
|
183
|
+
* event. Repeated calls while the socket is closed collapse to the latest
|
|
184
|
+
* payload (older ones are discarded).
|
|
185
|
+
*
|
|
186
|
+
* Returns a `Promise<void>` for API consistency; the promise resolves as
|
|
187
|
+
* soon as the payload has been stored and the opportunistic send attempted.
|
|
188
|
+
*
|
|
189
|
+
* @param {RealtimePresenceCreate} params - Presence payload (status and presenceId required, permissions/metadata optional)
|
|
190
|
+
*/
|
|
191
|
+
upsertPresence(params: RealtimePresenceCreate): Promise<void>;
|
|
192
|
+
private flushPendingPresence;
|
|
193
|
+
private handleMessage;
|
|
194
|
+
private handleResponseConnected;
|
|
195
|
+
private handleResponseError;
|
|
196
|
+
private handleResponseEvent;
|
|
197
|
+
}
|