@sylphx/sdk 0.31.0 → 0.32.1
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/README.md +131 -4
- package/dist/access.d.ts +146 -17
- package/dist/access.js +114 -8
- package/dist/access.js.map +1 -1
- package/dist/agents.d.ts +1564 -0
- package/dist/agents.js +1096 -0
- package/dist/agents.js.map +1 -0
- package/dist/ai.d.ts +1 -2
- package/dist/ai.js +2 -3
- package/dist/ai.js.map +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +2 -2
- package/dist/assets.d.ts +447 -0
- package/dist/assets.js +266 -0
- package/dist/assets.js.map +1 -0
- package/dist/auth/client.d.ts +239 -0
- package/dist/auth/client.js +337 -0
- package/dist/auth/client.js.map +1 -0
- package/dist/auth/end-user-keys-mock.d.ts +83 -0
- package/dist/auth/end-user-keys-mock.js +427 -0
- package/dist/auth/end-user-keys-mock.js.map +1 -0
- package/dist/auth/end-user-keys.d.ts +219 -0
- package/dist/auth/end-user-keys.js +240 -0
- package/dist/auth/end-user-keys.js.map +1 -0
- package/dist/auth/verify.d.ts +38 -3
- package/dist/auth/verify.js +58 -8
- package/dist/auth/verify.js.map +1 -1
- package/dist/auth.d.ts +656 -9
- package/dist/auth.js +563 -6
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +99 -21
- package/dist/billing.js +43 -5
- package/dist/billing.js.map +1 -1
- package/dist/broker.d.ts +5 -4
- package/dist/broker.js +3 -3
- package/dist/broker.js.map +1 -1
- package/dist/build.d.ts +362 -29
- package/dist/build.js +302 -10
- package/dist/build.js.map +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/config/flags.d.ts +140 -0
- package/dist/config/flags.js +462 -0
- package/dist/config/flags.js.map +1 -0
- package/dist/config.d.ts +380 -15
- package/dist/config.js +283 -5
- package/dist/config.js.map +1 -1
- package/dist/connections.d.ts +6 -6
- package/dist/connections.js +3 -3
- package/dist/data.d.ts +612 -7
- package/dist/data.js +566 -4
- package/dist/data.js.map +1 -1
- package/dist/entitlement.d.ts +10 -8
- package/dist/entitlement.js +3 -4
- package/dist/entitlement.js.map +1 -1
- package/dist/events/realtime.d.ts +69 -0
- package/dist/events/realtime.js +107 -0
- package/dist/events/realtime.js.map +1 -0
- package/dist/events/webhooks.d.ts +40 -0
- package/dist/events/webhooks.js +110 -0
- package/dist/events/webhooks.js.map +1 -0
- package/dist/events.d.ts +369 -22
- package/dist/events.js +311 -8
- package/dist/events.js.map +1 -1
- package/dist/flags.d.ts +18 -0
- package/dist/flags.js +44 -0
- package/dist/flags.js.map +1 -0
- package/dist/hosting.d.ts +13 -14
- package/dist/hosting.js +3 -4
- package/dist/hosting.js.map +1 -1
- package/dist/ids.d.ts +987 -0
- package/dist/ids.js +317 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +25 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +2 -2
- package/dist/keys.js +3 -3
- package/dist/knowledge.d.ts +1192 -0
- package/dist/knowledge.js +1002 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/localization.d.ts +663 -0
- package/dist/localization.js +491 -0
- package/dist/localization.js.map +1 -0
- package/dist/methods.js +3251 -133
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +3086 -0
- package/dist/money.js +2358 -0
- package/dist/money.js.map +1 -0
- package/dist/network.d.ts +4 -5
- package/dist/network.js +3 -4
- package/dist/network.js.map +1 -1
- package/dist/notify.d.ts +667 -125
- package/dist/notify.js +471 -73
- package/dist/notify.js.map +1 -1
- package/dist/observability.d.ts +322 -7
- package/dist/observability.js +244 -8
- package/dist/observability.js.map +1 -1
- package/dist/realtime.d.ts +404 -0
- package/dist/realtime.js +312 -0
- package/dist/realtime.js.map +1 -0
- package/dist/release.d.ts +14 -15
- package/dist/release.js +3 -4
- package/dist/release.js.map +1 -1
- package/dist/runners.d.ts +2 -3
- package/dist/runners.js +3 -4
- package/dist/runners.js.map +1 -1
- package/dist/runtime.d.ts +5 -1
- package/dist/runtime.js +7 -3
- package/dist/runtime.js.map +1 -1
- package/dist/sandboxes.d.ts +64 -20
- package/dist/sandboxes.js +9 -4
- package/dist/sandboxes.js.map +1 -1
- package/dist/secrets.d.ts +342 -6
- package/dist/secrets.js +271 -4
- package/dist/secrets.js.map +1 -1
- package/dist/workflows.d.ts +969 -15
- package/dist/workflows.js +815 -6
- package/dist/workflows.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import * as runtime from './runtime.js';
|
|
2
|
+
/** The request of BindSubscription. */
|
|
3
|
+
export interface BindSubscriptionRequest {
|
|
4
|
+
/** The Events Subscription's resource name. */
|
|
5
|
+
subscription: string;
|
|
6
|
+
/** The channel its events are published to, `namespace:name`. */
|
|
7
|
+
channel: string;
|
|
8
|
+
}
|
|
9
|
+
/** The response of BindSubscription. */
|
|
10
|
+
export interface BindSubscriptionResponse {
|
|
11
|
+
/** The Subscription bound. */
|
|
12
|
+
subscription?: string;
|
|
13
|
+
/** The channel it feeds. */
|
|
14
|
+
channel?: string;
|
|
15
|
+
}
|
|
16
|
+
/** ChannelGrant is the capabilities a token grants on one channel pattern. */
|
|
17
|
+
export interface ChannelGrant {
|
|
18
|
+
/**
|
|
19
|
+
* A channel name or pattern: `room:42`, or `room:*` for every channel of the
|
|
20
|
+
* namespace. `*` is allowed only as the whole name part, and never in the
|
|
21
|
+
* namespace part.
|
|
22
|
+
*/
|
|
23
|
+
pattern?: string;
|
|
24
|
+
/** The capabilities granted. At least one. */
|
|
25
|
+
capabilities?: Capability[];
|
|
26
|
+
}
|
|
27
|
+
/** The request of DeleteNamespace. */
|
|
28
|
+
export interface DeleteNamespaceRequest {
|
|
29
|
+
/** The namespace name. */
|
|
30
|
+
name: string;
|
|
31
|
+
}
|
|
32
|
+
/** The response of DeleteNamespace. */
|
|
33
|
+
export interface DeleteNamespaceResponse {
|
|
34
|
+
}
|
|
35
|
+
/** The request of GetNamespace. */
|
|
36
|
+
export interface GetNamespaceRequest {
|
|
37
|
+
/** The namespace name. */
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
/** The request of IssueToken. */
|
|
41
|
+
export interface IssueTokenRequest {
|
|
42
|
+
/** Which kind of token to mint. */
|
|
43
|
+
kind: TokenKind;
|
|
44
|
+
/** The end user's id. Required for a connection token. */
|
|
45
|
+
user?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The channels and capabilities to grant. A channel token takes exactly one
|
|
48
|
+
* grant whose pattern has no `*`. At most 64 grants.
|
|
49
|
+
*/
|
|
50
|
+
grants: ChannelGrant[];
|
|
51
|
+
/** How long the token lives; 1 minute to 24 hours, default 1 hour. */
|
|
52
|
+
ttl?: string;
|
|
53
|
+
}
|
|
54
|
+
/** The response of IssueToken. */
|
|
55
|
+
export interface IssueTokenResponse {
|
|
56
|
+
/**
|
|
57
|
+
* The token. Opaque; sent in the `connect` frame or the `Authorization`
|
|
58
|
+
* header, never in a URL.
|
|
59
|
+
*/
|
|
60
|
+
token?: string;
|
|
61
|
+
/** When it expires. */
|
|
62
|
+
expireTime?: string;
|
|
63
|
+
/** The claims the service put in it, for the caller to log or check. */
|
|
64
|
+
claims?: TokenClaims;
|
|
65
|
+
/**
|
|
66
|
+
* The realtime host the client connects to. Never hard-code it: it can
|
|
67
|
+
* change, with no port, and the protocol-v1 paths are fixed.
|
|
68
|
+
*/
|
|
69
|
+
connectUri?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The earliest the client should ask for a replacement: the in-band
|
|
72
|
+
* `refresh_required` frame arrives at this time.
|
|
73
|
+
*/
|
|
74
|
+
refreshTime?: string;
|
|
75
|
+
}
|
|
76
|
+
/** The request of ListMessages. */
|
|
77
|
+
export interface ListMessagesRequest {
|
|
78
|
+
/** The channel, `namespace:name`. */
|
|
79
|
+
channel: string;
|
|
80
|
+
/**
|
|
81
|
+
* Return messages after this cursor. Empty starts at the oldest kept
|
|
82
|
+
* message.
|
|
83
|
+
*/
|
|
84
|
+
cursor?: string;
|
|
85
|
+
/** At most this many messages; default 100, at most 1,000. */
|
|
86
|
+
pageSize?: number;
|
|
87
|
+
/**
|
|
88
|
+
* When no message is after the cursor, wait up to this many seconds for
|
|
89
|
+
* one; 0 to 30, default 0 (answer at once).
|
|
90
|
+
*/
|
|
91
|
+
waitSeconds?: number;
|
|
92
|
+
}
|
|
93
|
+
/** The response of ListMessages. */
|
|
94
|
+
export interface ListMessagesResponse {
|
|
95
|
+
/** The messages, oldest first. Empty when the wait ran out. */
|
|
96
|
+
messages?: Message[];
|
|
97
|
+
/**
|
|
98
|
+
* The cursor to pass as `cursor` next. Always set unless the
|
|
99
|
+
* namespace is ephemeral.
|
|
100
|
+
*/
|
|
101
|
+
nextCursor?: string;
|
|
102
|
+
}
|
|
103
|
+
/** The request of ListNamespaces. */
|
|
104
|
+
export interface ListNamespacesRequest {
|
|
105
|
+
/** At most this many namespaces; the service caps it. */
|
|
106
|
+
pageSize?: number;
|
|
107
|
+
/** The `next_page_token` of the previous page. */
|
|
108
|
+
pageToken?: string;
|
|
109
|
+
}
|
|
110
|
+
/** The response of ListNamespaces. */
|
|
111
|
+
export interface ListNamespacesResponse {
|
|
112
|
+
/** The page of namespaces. */
|
|
113
|
+
namespaces?: Namespace[];
|
|
114
|
+
/** Empty on the last page. */
|
|
115
|
+
nextPageToken?: string;
|
|
116
|
+
}
|
|
117
|
+
/** The request of ListPresence. */
|
|
118
|
+
export interface ListPresenceRequest {
|
|
119
|
+
/** The channel, `namespace:name`. */
|
|
120
|
+
channel: string;
|
|
121
|
+
/** At most this many members; default 100, at most 1,000. */
|
|
122
|
+
pageSize?: number;
|
|
123
|
+
/** The `next_page_token` of the previous page. */
|
|
124
|
+
pageToken?: string;
|
|
125
|
+
}
|
|
126
|
+
/** The response of ListPresence. */
|
|
127
|
+
export interface ListPresenceResponse {
|
|
128
|
+
/** The members present. */
|
|
129
|
+
members?: Member[];
|
|
130
|
+
/** Empty on the last page. */
|
|
131
|
+
nextPageToken?: string;
|
|
132
|
+
}
|
|
133
|
+
/** Member is one connection present on a channel. */
|
|
134
|
+
export interface Member {
|
|
135
|
+
/** The user id from the token. */
|
|
136
|
+
user?: string;
|
|
137
|
+
/** The connection id, unique while the connection lives. */
|
|
138
|
+
connectionId?: string;
|
|
139
|
+
/** The application's presence data, at most 4 KiB encoded. */
|
|
140
|
+
data?: unknown;
|
|
141
|
+
/** When this connection entered. */
|
|
142
|
+
enterTime?: string;
|
|
143
|
+
}
|
|
144
|
+
/** Message is one message of a channel. */
|
|
145
|
+
export interface Message {
|
|
146
|
+
/** The channel, `namespace:name`. */
|
|
147
|
+
channel?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The message's cursor: opaque, ordered within the channel, and the value
|
|
150
|
+
* to resume from. Empty in an ephemeral namespace.
|
|
151
|
+
*/
|
|
152
|
+
cursor?: string;
|
|
153
|
+
/** The application's event name, for example `move`. 1 to 64 characters. */
|
|
154
|
+
event?: string;
|
|
155
|
+
/** The JSON payload, at most 64 KiB encoded. */
|
|
156
|
+
data?: unknown;
|
|
157
|
+
/** The user id of the publisher; empty when a server published without one. */
|
|
158
|
+
publisher?: string;
|
|
159
|
+
/** When the service accepted the message. */
|
|
160
|
+
publishTime?: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Namespace is the only configured object of Sylphx Realtime. It carries the
|
|
164
|
+
* rules of every channel named `<namespace>:<name>`. Channels are implicit:
|
|
165
|
+
* they exist from their first publish or subscribe and are never created.
|
|
166
|
+
* Declared in `sylphx.toml` as `[realtime.namespaces.<name>]`.
|
|
167
|
+
*/
|
|
168
|
+
export interface Namespace {
|
|
169
|
+
/**
|
|
170
|
+
* The namespace name: 1 to 32 characters of `a-z`, `0-9`, `-` and `_`,
|
|
171
|
+
* starting with a letter. It is the part of a channel before the first
|
|
172
|
+
* colon, and never changes.
|
|
173
|
+
*/
|
|
174
|
+
name?: string;
|
|
175
|
+
/** How much history channels keep. Default NONE. */
|
|
176
|
+
history?: HistoryPreset;
|
|
177
|
+
/** Whether channels track who is present. Default off. */
|
|
178
|
+
presence?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Whether a client holding a token with the publish capability may publish.
|
|
181
|
+
* Default off: only servers publish.
|
|
182
|
+
*/
|
|
183
|
+
clientPublish?: boolean;
|
|
184
|
+
/** When the namespace was created. */
|
|
185
|
+
readonly createTime?: string;
|
|
186
|
+
/** When the rules last changed. */
|
|
187
|
+
readonly updateTime?: string;
|
|
188
|
+
}
|
|
189
|
+
/** The request of Publish. */
|
|
190
|
+
export interface PublishRequest {
|
|
191
|
+
/**
|
|
192
|
+
* The channel, `namespace:name`: the name is 1 to 128 characters of
|
|
193
|
+
* `a-z A-Z 0-9 - _ . =` and no `*`.
|
|
194
|
+
*/
|
|
195
|
+
channel: string;
|
|
196
|
+
/** The application's event name, 1 to 64 characters. */
|
|
197
|
+
event: string;
|
|
198
|
+
/** The JSON payload, at most 64 KiB encoded. */
|
|
199
|
+
data?: unknown;
|
|
200
|
+
}
|
|
201
|
+
/** The response of Publish. */
|
|
202
|
+
export interface PublishResponse {
|
|
203
|
+
/** The published message; its cursor is empty in an ephemeral namespace. */
|
|
204
|
+
message?: Message;
|
|
205
|
+
}
|
|
206
|
+
/** The request of PutNamespace. */
|
|
207
|
+
export interface PutNamespaceRequest {
|
|
208
|
+
/** The namespace name; see Namespace.name. */
|
|
209
|
+
name: string;
|
|
210
|
+
/** How much history channels keep. */
|
|
211
|
+
history?: HistoryPreset;
|
|
212
|
+
/** Whether channels track presence. */
|
|
213
|
+
presence?: boolean;
|
|
214
|
+
/** Whether clients may publish. */
|
|
215
|
+
clientPublish?: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* TokenClaims are the claims every Sylphx Realtime token carries. A token is
|
|
219
|
+
* opaque to SDK users; this message states what the service puts in it and
|
|
220
|
+
* what it checks.
|
|
221
|
+
*/
|
|
222
|
+
export interface TokenClaims {
|
|
223
|
+
/** The token's kind. */
|
|
224
|
+
kind?: TokenKind;
|
|
225
|
+
/**
|
|
226
|
+
* The authoritative Access environment id, not a client-supplied value.
|
|
227
|
+
* Valid only within the organization, project and cell below.
|
|
228
|
+
*/
|
|
229
|
+
environment?: string;
|
|
230
|
+
/**
|
|
231
|
+
* The end user's id (`sub`). Required for a connection token; it is the
|
|
232
|
+
* user shown in presence.
|
|
233
|
+
*/
|
|
234
|
+
user?: string;
|
|
235
|
+
/**
|
|
236
|
+
* The channels the holder may use. A connection token holds the grants of
|
|
237
|
+
* every channel its connection may touch; a channel token holds exactly one.
|
|
238
|
+
*/
|
|
239
|
+
grants?: ChannelGrant[];
|
|
240
|
+
/** When the token was issued. */
|
|
241
|
+
issueTime?: string;
|
|
242
|
+
/**
|
|
243
|
+
* When the token expires. Between issue time plus 1 minute and 24 hours.
|
|
244
|
+
* The service closes a connection whose token has expired and was not
|
|
245
|
+
* refreshed.
|
|
246
|
+
*/
|
|
247
|
+
expireTime?: string;
|
|
248
|
+
/** A unique id; the service can revoke a token by it until it expires. */
|
|
249
|
+
tokenId?: string;
|
|
250
|
+
/**
|
|
251
|
+
* The issuing Access key id (not its secret). Required: the service rechecks
|
|
252
|
+
* its freshness, expiry, revocation and token-issuing authority through the
|
|
253
|
+
* Access verifier at admission, refresh and while the connection is open.
|
|
254
|
+
*/
|
|
255
|
+
issuerKeyId?: string;
|
|
256
|
+
/** The authoritative Access organization id of the issuing tenant. Required. */
|
|
257
|
+
organization?: string;
|
|
258
|
+
/** The authoritative Access project id of the issuing tenant. Required. */
|
|
259
|
+
project?: string;
|
|
260
|
+
/** The authoritative Access cell id of the issuing tenant. Required. */
|
|
261
|
+
cell?: string;
|
|
262
|
+
}
|
|
263
|
+
/** Capability is one thing a token lets its holder do on a channel pattern. */
|
|
264
|
+
export type Capability = 'subscribe' | 'publish' | 'presence' | (string & {});
|
|
265
|
+
/**
|
|
266
|
+
* HistoryPreset is how much of a channel's past a namespace keeps. Longer
|
|
267
|
+
* retention is not a realtime feature: route the channel's messages to an
|
|
268
|
+
* Events topic.
|
|
269
|
+
*/
|
|
270
|
+
export type HistoryPreset = 'none' | 'short' | 'standard' | (string & {});
|
|
271
|
+
/** TokenKind says what a token connects. */
|
|
272
|
+
export type TokenKind = 'connection' | 'channel' | (string & {});
|
|
273
|
+
/**
|
|
274
|
+
* ChannelService is the Channel API of Sylphx Realtime: the server side that
|
|
275
|
+
* configures namespaces, publishes, reads history, lists presence, and mints
|
|
276
|
+
* the tokens clients connect with. It is served by the Events service at the
|
|
277
|
+
* Realtime origin, not by the Resource API, and is called with the
|
|
278
|
+
* environment's secret key (`SYLPHX_API_KEY`); the key's org, project and
|
|
279
|
+
* environment are the tenant. Clients connect with a token over the Sylphx
|
|
280
|
+
* channel protocol v1 (`protocol.proto`).
|
|
281
|
+
*
|
|
282
|
+
* The same calls become MCP tools. An agent cannot hold a socket, so
|
|
283
|
+
* ListMessages with `wait_seconds` is its subscribe.
|
|
284
|
+
*
|
|
285
|
+
* Namespace of Sylphx Realtime on `Sylphx`.
|
|
286
|
+
*/
|
|
287
|
+
export declare class RealtimeApi {
|
|
288
|
+
/** The `namespaces` collection. */
|
|
289
|
+
readonly namespaces: NamespacesCollection;
|
|
290
|
+
/** The `channels` collection. */
|
|
291
|
+
readonly channels: ChannelsCollection;
|
|
292
|
+
/** The `tokens` collection. */
|
|
293
|
+
readonly tokens: TokensCollection;
|
|
294
|
+
/** The `bindings` collection. */
|
|
295
|
+
readonly bindings: BindingsCollection;
|
|
296
|
+
constructor(client: runtime.Client);
|
|
297
|
+
}
|
|
298
|
+
/** `namespaces` of Sylphx Realtime: served at `https://api.realtime.sylphx.com`. */
|
|
299
|
+
export declare class NamespacesCollection {
|
|
300
|
+
private readonly client;
|
|
301
|
+
constructor(client: runtime.Client);
|
|
302
|
+
/**
|
|
303
|
+
* Creates or replaces a namespace's rules. Existing channels follow the new
|
|
304
|
+
* rules from their next message; shortening history trims at the next
|
|
305
|
+
* publish.
|
|
306
|
+
*
|
|
307
|
+
* `PUT /v1/namespaces/{name}` · permission `realtime:write` · effect `write`
|
|
308
|
+
*
|
|
309
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PLAN_LIMIT_REACHED`.
|
|
310
|
+
*/
|
|
311
|
+
put(request: PutNamespaceRequest): Promise<Namespace>;
|
|
312
|
+
/**
|
|
313
|
+
* Reads a namespace.
|
|
314
|
+
*
|
|
315
|
+
* `GET /v1/namespaces/{name}` · permission `realtime:read` · effect `read`
|
|
316
|
+
*
|
|
317
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
318
|
+
*/
|
|
319
|
+
get(request: GetNamespaceRequest): Promise<Namespace>;
|
|
320
|
+
/**
|
|
321
|
+
* Lists the environment's namespaces.
|
|
322
|
+
*
|
|
323
|
+
* `GET /v1/namespaces` · permission `realtime:read` · effect `read`
|
|
324
|
+
*
|
|
325
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
|
|
326
|
+
*/
|
|
327
|
+
list(request: ListNamespacesRequest): Promise<ListNamespacesResponse>;
|
|
328
|
+
/**
|
|
329
|
+
* Deletes a namespace, its channels' history and presence, and closes the
|
|
330
|
+
* subscriptions on them.
|
|
331
|
+
*
|
|
332
|
+
* `DELETE /v1/namespaces/{name}` · permission `realtime:write` · effect `destructive`
|
|
333
|
+
*
|
|
334
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
335
|
+
*/
|
|
336
|
+
delete(request: DeleteNamespaceRequest): Promise<DeleteNamespaceResponse>;
|
|
337
|
+
}
|
|
338
|
+
/** `channels` of Sylphx Realtime: served at `https://api.realtime.sylphx.com`. */
|
|
339
|
+
export declare class ChannelsCollection {
|
|
340
|
+
private readonly client;
|
|
341
|
+
constructor(client: runtime.Client);
|
|
342
|
+
/**
|
|
343
|
+
* Publishes a message to a channel. The namespace must exist. The server
|
|
344
|
+
* publishes regardless of `client_publish`. A repeated Sylphx-Effect-Id
|
|
345
|
+
* publishes once.
|
|
346
|
+
*
|
|
347
|
+
* `POST /v1/channels:publish` · permission `realtime:publish` · effect `write`
|
|
348
|
+
*
|
|
349
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
|
|
350
|
+
*/
|
|
351
|
+
publish(request: PublishRequest): Promise<PublishResponse>;
|
|
352
|
+
/**
|
|
353
|
+
* Lists a channel's messages after a cursor, oldest first. With
|
|
354
|
+
* `wait_seconds`, an empty result waits up to that long for the first new
|
|
355
|
+
* message and answers as soon as one arrives: this is how an agent
|
|
356
|
+
* subscribes.
|
|
357
|
+
*
|
|
358
|
+
* `GET /v1/channels/{channel}/messages` · permission `realtime:read` · effect `read`
|
|
359
|
+
*
|
|
360
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
|
|
361
|
+
*/
|
|
362
|
+
history(request: ListMessagesRequest): Promise<ListMessagesResponse>;
|
|
363
|
+
/**
|
|
364
|
+
* Lists who is present on a channel.
|
|
365
|
+
*
|
|
366
|
+
* `GET /v1/channels/{channel}/presence` · permission `realtime:read` · effect `read`
|
|
367
|
+
*
|
|
368
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
|
|
369
|
+
*/
|
|
370
|
+
presence(request: ListPresenceRequest): Promise<ListPresenceResponse>;
|
|
371
|
+
}
|
|
372
|
+
/** `tokens` of Sylphx Realtime: served at `https://api.realtime.sylphx.com`. */
|
|
373
|
+
export declare class TokensCollection {
|
|
374
|
+
private readonly client;
|
|
375
|
+
constructor(client: runtime.Client);
|
|
376
|
+
/**
|
|
377
|
+
* Mints a connection or channel token for an end user. The customer's
|
|
378
|
+
* server calls it with the secret key after authenticating the user, and
|
|
379
|
+
* hands the token to the client.
|
|
380
|
+
*
|
|
381
|
+
* `POST /v1/tokens:issue` · permission `realtime:token` · effect `write`
|
|
382
|
+
*
|
|
383
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
|
|
384
|
+
*/
|
|
385
|
+
issue(request: IssueTokenRequest): Promise<IssueTokenResponse>;
|
|
386
|
+
}
|
|
387
|
+
/** `bindings` of Sylphx Realtime: served at `https://api.realtime.sylphx.com`. */
|
|
388
|
+
export declare class BindingsCollection {
|
|
389
|
+
private readonly client;
|
|
390
|
+
constructor(client: runtime.Client);
|
|
391
|
+
/**
|
|
392
|
+
* Binds a bus Subscription's matching events to a channel: each event the
|
|
393
|
+
* Subscription matches is published to the channel, with the event's
|
|
394
|
+
* CloudEvents `type` as the message event and its `data` as the payload. The
|
|
395
|
+
* Subscription itself is an Events Resource (`sylphx.events.v1`); this call
|
|
396
|
+
* only names the channel it feeds, and replaces the Subscription's earlier
|
|
397
|
+
* binding.
|
|
398
|
+
*
|
|
399
|
+
* `POST /v1/subscription-bindings` · permission `realtime:write` · effect `write`
|
|
400
|
+
*
|
|
401
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
|
|
402
|
+
*/
|
|
403
|
+
create(request: BindSubscriptionRequest): Promise<BindSubscriptionResponse>;
|
|
404
|
+
}
|