Skip to content

Commit b90fcdf

Browse files
committed
Update the rest of JS API references to ably-js v2 - Promises and API
This includes next changes for the JS API: - update Messages docs - update ClientOptions docs - update Encryption docs - update Stats docs - update Request docs - update Connection docs - update Presence docs - update Authentication docs - update History docs - update Push Device docs - update PushAdmin docs - update PaginatedResult and HttpPaginatedResponse docs - add docs for batch publish and batch presence - various formatting, styling and bug fixes across the board
1 parent 521c24f commit b90fcdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1391
-662
lines changed

content/api/realtime-sdk.textile

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ h6(#connect).
122122
csharp: Connect
123123

124124
bq(definition).
125-
default: connect()
125+
default: connect(): void
126126
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable connect -> yields "@Connection@":/docs/api/realtime-sdk/connection
127127
java: void connect()
128128
csharp: void Connect()
@@ -143,7 +143,7 @@ h6(#close).
143143
csharp: Close
144144

145145
bq(definition).
146-
default: close()
146+
default: close(): void
147147
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable close -> yields "@Connection@":/docs/api/realtime-sdk/connection
148148
java: void close()
149149
csharp: void Close()
@@ -164,14 +164,14 @@ h6(#stats).
164164
csharp: Stats
165165

166166
bq(definition).
167-
default: stats(Object options, callback("ErrorInfo":/docs/api/realtime-sdk/types#error-info err, "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats> results))
168-
jsall: stats(params?): Promise<"PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats>>
169-
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable stats(Hash options) -> yields "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats>
170-
java: "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats> stats("Param":#param[] options)
171-
swift,objc: stats(query: ARTStatsQuery?, callback: ("ARTPaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"ARTStats":/docs/api/realtime-sdk/types#stats>?, ARTErrorInfo?) -> Void) throws
172-
csharp: Task<"PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":/docs/api/realtime-sdk/types#stats>> StatsAsync(StatsRequestParams query)
167+
default: stats(Object options, callback("ErrorInfo":/docs/api/realtime-sdk/types#error-info err, "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats-type> results))
168+
jsall: stats(Object params?): Promise<"PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats-type>>
169+
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable stats(Hash options) -> yields "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats-type>
170+
java: "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats-type> stats("Param":#param[] options)
171+
swift,objc: stats(query: ARTStatsQuery?, callback: ("ARTPaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"ARTStats":#stats-type>?, ARTErrorInfo?) -> Void) throws
172+
csharp: Task<"PaginatedResult":/docs/api/realtime-sdk/types#paginated-result<"Stats":#stats-type>> StatsAsync(StatsRequestParams query)
173173

174-
This call queries the "REST @/stats@ API":/docs/api/rest-api#stats and retrieves your application's usage statistics. A "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result is returned, containing an array of "Stats":#stats for the first page of results. "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result objects are iterable providing a means to page through historical statistics. "See an example set of raw stats returned via the REST API":/docs/metadata-stats/stats#metrics.
174+
This call queries the "REST @/stats@ API":/docs/api/rest-api#stats and retrieves your application's usage statistics. A "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result is returned, containing an array of "Stats":#stats-type for the first page of results. "PaginatedResult":/docs/api/realtime-sdk/types#paginated-result objects are iterable providing a means to page through historical statistics. "See an example set of raw stats returned via the REST API":/docs/metadata-stats/stats#metrics.
175175

176176
See "statistics":/docs/metadata-stats/stats for more information.
177177

@@ -183,18 +183,18 @@ h6(#time).
183183

184184
bq(definition).
185185
default: time(callback("ErrorInfo":/docs/api/realtime-sdk/types#error-info err, Number time))
186-
jsall: time(): Promise<Number>
187-
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable time -> yields Time
188-
java: long time()
189-
csharp: Task<DateTimeOffset> TimeAsync()
186+
jsall: time(): Promise<Number>
187+
ruby: "Deferrable":/docs/api/realtime-sdk/types#deferrable time -> yields Time
188+
java: long time()
189+
csharp: Task<DateTimeOffset> TimeAsync()
190190
objc,swift: time(callback: (NSDate?, NSError?) -> Void)
191191

192192
Obtains the time from the Ably service as <span lang="ruby">a @Time@ object</span><span lang="csharp">a @DateTimeOffset@ object</span><span lang="default">milliseconds since epoch</span>. (Clients that do not have access to a sufficiently well maintained time source and wish to issue Ably "TokenRequests":/docs/api/realtime-sdk/authentication#token-request with a more accurate timestamp should use the @queryTime@ "clientOptions":#client-options instead of this method).
193193

194194
blang[jsall].
195195
h4. Returns
196196

197-
Returns a promise. On success, the promise is fulfilled with the time as milliseconds since the Unix epoch. On failure, the promise is rejected with an "@ErrorInfo@":/api/realtime-sdk/types#error-info object.
197+
Returns a promise. On success, the promise is fulfilled with the time as milliseconds since the Unix epoch. On failure, the promise is rejected with an "@ErrorInfo@":/docs/api/realtime-sdk/types#error-info object.
198198

199199
blang[objc,swift].
200200
h4. Callback result
@@ -236,38 +236,38 @@ blang[javascript].
236236
There are two overloaded versions of this method:
237237

238238
bq(definition#batchPublish).
239-
default: batchPublish(spec): Promise<BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>>
239+
default: batchPublish("BatchPublishSpec":#batch-publish-spec spec): Promise<"BatchResult":#batch-result<"BatchPublishSuccessResult":#batch-publish-success-result | "BatchPublishFailureResult":#batch-publish-failure-result>>
240240

241-
Publishes a "@BatchPublishSpec@":LINK object to one or more channels, up to a maximum of 100 channels.
241+
Publishes a "@BatchPublishSpec@":#batch-publish-spec object to one or more channels, up to a maximum of 100 channels.
242242

243243
bq(definition#batchPublishArray).
244-
default: batchPublish(specs): Promise<BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>[]>
244+
default: batchPublish("BatchPublishSpec[]":#batch-publish-spec specs): Promise<"BatchResult":#batch-result<"BatchPublishSuccessResult":#batch-publish-success-result | "BatchPublishFailureResult":#batch-publish-failure-result>[]>
245245

246-
Publishes one or more "@BatchPublishSpec@":LINK objects to one or more channels, up to a maximum of 100 channels.
246+
Publishes one or more "@BatchPublishSpec@":#batch-publish-spec objects to one or more channels, up to a maximum of 100 channels.
247247

248248
h4. Parameters
249249

250-
- spec := an object describing the messages to be batch published and to which channels<br>__Type: "@BatchPublishSpec@":LINK__
251-
- specs := an array of objects describing the messages to be batch published and to which channels<br>__Type: "@BatchPublishSpec@[]":LINK__
250+
- spec := an object describing the messages to be batch published and to which channels<br>__Type: "@BatchPublishSpec@":#batch-publish-spec
251+
- specs := an array of objects describing the messages to be batch published and to which channels<br>__Type: "@BatchPublishSpec@[]":#batch-publish-spec
252252

253253
h4. Returns
254254

255-
Returns a promise. On success, the promise is fulfilled with a "@BatchResult@":/LINK object, or an array of @BatchResult@ objects, containing information about the result of the batch publish operation for each channel. The successful results of specific channels are returned as "@BatchPublishSuccessResult@":/LINK objects, whilst failures are "@BatchPublishFailureResult@":/LINK objects. If an array of @BatchResult@ objects are returned, they are in the same order as the provided "@BatchPublishSpec@":/LINK. On failure, the promise is rejected with an "@ErrorInfo@":/api/realtime-sdk/types#error-info object.
255+
Returns a promise. On success, the promise is fulfilled with a "@BatchResult@":#batch-result object, or an array of "@BatchResult@":#batch-result objects, containing information about the result of the batch publish operation for each channel. The successful results of specific channels are returned as "@BatchPublishSuccessResult@":#batch-publish-success-result objects, whilst failures are "@BatchPublishFailureResult@":#batch-publish-failure-result objects. If an array of "@BatchResult@":#batch-result objects are returned, they are in the same order as the provided "@BatchPublishSpec@":#batch-publish-spec. On failure, the promise is rejected with an "@ErrorInfo@":/docs/api/realtime-sdk/types#error-info object.
256256

257257
h6(#batchPresence). batchPresence
258258

259259
bq(definition#batchPresence).
260-
default: batchPresence(channels): Promise<BatchResult<BatchPresenceSuccessResult | BatchPresenceFailureResult>[]>
260+
default: batchPresence(String[] channels): Promise<"BatchResult":#batch-result<"BatchPresenceSuccessResult":#batch-presence-success-result | "BatchPresenceFailureResult":#batch-presence-failure-result>[]>
261261

262-
Retrieves the presence state for one or more channels, up to a maximum of 100 channels. Presence state includes the "@clientId@":#client-options of members and their current "@PresenceAction@":/api/realtime-sdk/presence#presence-action
262+
Retrieves the presence state for one or more channels, up to a maximum of 100 channels. Presence state includes the "@clientId@":#client-options of members and their current "@PresenceAction@":/docs/api/realtime-sdk/presence#presence-action.
263263

264264
h4. Parameters
265265

266266
- channels := an array of one or more channel names, up to a maximum of 100 channels<br>__Type: @String[]@__
267267

268268
h4. Returns
269269

270-
Returns a promise. On success, the promise is fulfilled with a "@BatchResult@":/LINK object containing information about the result of the batch presence request for each channel. The successful results of specific channels are returned as "@BatchPresenceSuccessResult@":/LINK objects, whilst failures are "@BatchPresenceFailureResult@":/LINK objects. On failure, the promise is rejected with an "@ErrorInfo@":/api/realtime-sdk/types#error-info object.
270+
Returns a promise. On success, the promise is fulfilled with a "@BatchResult@":#batch-result object containing information about the result of the batch presence request for each channel. The successful results of specific channels are returned as "@BatchPresenceSuccessResult@":#batch-presence-success-result objects, whilst failures are "@BatchPresenceFailureResult@":#batch-presence-failure-result objects. On failure, the promise is rejected with an "@ErrorInfo@":/docs/api/realtime-sdk/types#error-info object.
271271

272272
h2(#related-types). Related types
273273

@@ -293,6 +293,8 @@ h3(#stats-type).
293293

294294
h3(#stats-granularity).
295295
objc,swift: ARTStatsGranularity
296+
jsall: StatsIntervalGranularity
297+
csharp: StatsIntervalGranularity
296298

297299
<%= partial partial_version('types/_stats_granularity') %>
298300

@@ -306,3 +308,35 @@ h3(#param).
306308

307309
blang[java].
308310
<%= partial partial_version('types/_param'), indent: 2, skip_first_indent: true %>
311+
312+
blang[jsall].
313+
314+
h3(#batch-publish-spec).
315+
jsall: BatchPublishSpec
316+
317+
<%= partial partial_version('types/_batch_publish_spec') %>
318+
319+
h3(#batch-result).
320+
jsall: BatchResult
321+
322+
<%= partial partial_version('types/_batch_result') %>
323+
324+
h3(#batch-publish-success-result).
325+
jsall: BatchPublishSuccessResult
326+
327+
<%= partial partial_version('types/_batch_publish_success_result') %>
328+
329+
h3(#batch-publish-failure-result).
330+
jsall: BatchPublishFailureResult
331+
332+
<%= partial partial_version('types/_batch_publish_failure_result') %>
333+
334+
h3(#batch-presence-success-result).
335+
jsall: BatchPresenceSuccessResult
336+
337+
<%= partial partial_version('types/_batch_presence_success_result') %>
338+
339+
h3(#batch-presence-failure-result).
340+
jsall: BatchPresenceFailureResult
341+
342+
<%= partial partial_version('types/_batch_presence_failure_result') %>

0 commit comments

Comments
 (0)