You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: textile/api-docstrings.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,6 +286,22 @@ Enables messages to be published and historic messages to be retrieved for a cha
286
286
||`data`||| The payload of the message. |
287
287
| setOptions(options: ChannelOptions) => io ||| RSL7 | Sets the [`ChannelOptions`]{@link ChannelOptions} for the channel. |
288
288
||`options`||| A [`ChannelOptions`]{@link ChannelOptions} object. |
289
+
| getMessage(serialOrMsg: String \| Message) => io Message ||| RSL11 | Retrieves the latest version of a specific message by its serial identifier or by providing a [`Message`]{@link Message} object containing the serial (which will not be mutated). |
290
+
||`serialOrMsg`||| Either the serial identifier string of the message to retrieve, or a [`Message`]{@link Message} object containing a populated `serial` field. |
291
+
|||`Message`|| A [`Message`]{@link Message}, the latest version of the message |
292
+
| updateMessage(Message, operation?: MessageOperation, params?: `Dict<String, Stringifiable>`) => io Message ||| RSL12 | Publishes an update to existing message with patch semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Note that this publishes an update, it does not mutate the original message if passed in. |
293
+
||`Message`||| A [`Message`]{@link Message} object containing a populated `serial` field and the fields to update. |
294
+
||`operation`||| An optional [`MessageOperation`]{@link MessageOperation} object containing metadata about the update operation. |
295
+
||`params`||| Optional parameters sent as part of the query string. |
296
+
|||`Message`|| A [`Message`]{@link Message} object containing the updated message. |
297
+
| deleteMessage(Message, operation?: MessageOperation, params?: `Dict<String, Stringifiable>`) => io ||| RSL13 | Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses patch semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged (meaning that if you for example want the `MESSAGE_DELETE` to have an empty data, you should explicitly set the `data` to an empty object). |
298
+
||`Message`||| A [`Message`]{@link Message} object containing a populated `serial` field. |
299
+
||`operation`||| An optional [`MessageOperation`]{@link MessageOperation} object containing metadata about the delete operation. |
300
+
||`params`||| Optional parameters sent as part of the query string. |
301
+
| getMessageVersions(serialOrMsg: String \| Message, params?: `Dict<String, Stringifiable>`) => io `PaginatedResult<Message>`||| RSL14 | Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations. |
302
+
||`serialOrMsg`||| Either the serial identifier string of the message whose versions are to be retrieved, or a [`Message`]{@link Message} object containing a populated `serial` field. |
303
+
||`params`||| Optional parameters sent as part of the query string. |
304
+
|||`PaginatedResult<Message>`|| A [`PaginatedResult`]{@link PaginatedResult} object containing an array of [`Message`]{@link Message} objects representing all versions of the message. |
@@ -351,6 +367,22 @@ Enables messages to be published and subscribed to. Also enables historic messag
351
367
||`(Message)`||| An event listener function. |
352
368
| setOptions(options: ChannelOptions) => io ||| RTL16 | Sets the [`ChannelOptions`]{@link ChannelOptions} for the channel. An optional callback may be provided to notify of the success or failure of the operation. |
353
369
||`options`||| A [`ChannelOptions`]{@link ChannelOptions} object. |
370
+
| getMessage(serialOrMsg: String \| Message) => io Message ||| RTL28 | Retrieves the latest version of a specific message by its serial identifier or by providing a [`Message`]{@link Message} object containing the serial. |
371
+
||`serialOrMsg`||| Either the serial identifier string of the message to retrieve, or a [`Message`]{@link Message} object containing a populated `serial` field. |
372
+
|||`Message`|| A [`Message`]{@link Message}, the latest version of the message |
373
+
| updateMessage(Message, operation?: MessageOperation, params?: `Dict<String, Stringifiable>`) => io Message ||| RTL29 | Updates an existing message with patch semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Note that this publishes an update, it does not mutate the original message if passed in. |
374
+
||`Message`||| A [`Message`]{@link Message} object containing a populated `serial` field and the fields to update. |
375
+
||`operation`||| An optional [`MessageOperation`]{@link MessageOperation} object containing metadata about the update operation. |
376
+
||`params`||| Optional parameters sent as part of the query string. |
377
+
|||`Message`|| A [`Message`]{@link Message} object containing the updated message. |
378
+
| deleteMessage(Message, operation?: MessageOperation, params?: `Dict<String, Stringifiable>`) => io ||| RTL30 | Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses patch semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged (meaning that if you for example want the `MESSAGE_DELETE` to have an empty data, you should explicitly set the `data` to an empty object). |
379
+
||`Message`||| A [`Message`]{@link Message} object containing a populated `serial` field. |
380
+
||`operation`||| An optional [`MessageOperation`]{@link MessageOperation} object containing metadata about the delete operation. |
381
+
||`params`||| Optional parameters sent as part of the query string. |
382
+
| getMessageVersions(serialOrMsg: String \| Message, params?: `Dict<String, Stringifiable>`) => io `PaginatedResult<Message>`||| RTL31 | Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations. |
383
+
||`serialOrMsg`||| Either the serial identifier string of the message whose versions are to be retrieved, or a [`Message`]{@link Message} object containing a populated `serial` field. |
384
+
||`params`||| Optional parameters sent as part of the query string. |
385
+
|||`PaginatedResult<Message>`|| A [`PaginatedResult`]{@link PaginatedResult} object containing an array of [`Message`]{@link Message} objects representing all versions of the message. |
354
386
355
387
## class MessageFilterObject
356
388
@@ -364,6 +396,16 @@ Contains properties to filter messages with when calling [`subscribe()`]{@link R
364
396
| name: string ||| RTL22a | Filters messages by a specific message `name`. |
365
397
| clientId: string ||| RTL22a | Filters messages by a specific message `clientId`. |
366
398
399
+
## class MessageOperation
400
+
401
+
Contains metadata about a message update or delete operation.
* @(RSL8)@ @RestChannel#status@ function: makes a http get request to @<restHost>/channels/<channelId>@ where @<restHost>@ represents the current rest host as described by "@RSC11@":#RSC11
382
382
** @(RSL8a)@ Returns a @ChannelDetails@ object
383
383
* @(RSL10)@ @RestChannel#annotations@ attribute contains the @RestAnnotations@ object for this channel
384
+
* @(RSL11)@ @RestChannel#getMessage@ function:
385
+
** @(RSL11a)@ Takes a first argument of a @serial@ string of the message to be retrieved.
386
+
*** @(RSL11a1)@ In languages where method overloading is supported, the first argument should also accept a @Message@ object (which must contain a populated @serial@ field)
387
+
** @(RSL11b)@ The SDK must send a GET request to the endpoint @/channels/{channelName}/messages/{serial}@
388
+
** @(RSL11c)@ Returns the decoded @Message@ object for the specified message serial
389
+
* @(RSL12)@ @RestChannel#updateMessage@ function:
390
+
** @(RSL12a)@ Takes a first argument of a @Message@ object (which must contain a populated @serial@ field), an optional second argument of a @MessageOperation@ object, and an optional third argument of @Dict<string, stringifiable>@ publish params
391
+
** @(RSL12b)@ The SDK must send a PATCH to @/channels/{channelName}/messages/{serial}@, with any @params@ sent in the querystring. The request body consists of an object with the following fields:
392
+
*** @(RSL12b1)@ @serial@ - the serial identifier of the message being updated
393
+
*** @(RSL12b2)@ @operation@ - the @MessageOperation@ object if provided
394
+
*** @(RSL12b3)@ @name@ - the message name from the @Message@ object if provided
395
+
*** @(RSL12b4)@ @data@ - the message data from the @Message@ object if provided, encoded per @RSL4@
396
+
*** @(RSL12b5)@ @encoding@ - the encoding field set according to @RSL4@ if @data@ was encoded
397
+
*** @(RSL12b6)@ @extras@ - the extras field from the @Message@ object if provided
398
+
** @(RSL12c)@ The body must be encoded to the appropriate format per @RSC8@
399
+
** @(RSL12d)@ Returns the updated @Message@ object, which the server will have responded with
400
+
* @(RSL13)@ @RestChannel#deleteMessage@ function:
401
+
** @(RSL13a)@ Takes a first argument of a @Message@ object (which must contain a populated @serial@ field), an optional second argument of a @MessageOperation@ object, and an optional third argument of @Dict<string, stringifiable>@ publish params
402
+
** @(RSL13b)@ The SDK must send a POST to @/channels/{channelName}/messages/{serial}/delete@, with any @params@ sent in the querystring. The request body consists of an object with the following fields:
403
+
*** @(RSL13b1)@ @serial@ - the serial identifier of the message being deleted
404
+
*** @(RSL13b2)@ @operation@ - the @MessageOperation@ object if provided
405
+
*** @(RSL13b3)@ @name@ - the message name from the @Message@ object if provided
406
+
*** @(RSL13b4)@ @data@ - the message data from the @Message@ object if provided, encoded per @RSL4@
407
+
*** @(RSL13b5)@ @encoding@ - the encoding field set according to @RSL4@ if @data@ was encoded
408
+
*** @(RSL13b6)@ @extras@ - the extras field from the @Message@ object if provided
409
+
** @(RSL13c)@ The body must be encoded to the appropriate format per @RSC8@
410
+
** @(RSL13d)@ Returns the updated (well, 'deleted') @Message@ object, which the server will have responded with
** @(RSL14a)@ Takes a first argument a @serial@ string of the message whose versions are to be retrieved, and an optional second argument of @Dict<string, stringifiable>@ params
413
+
*** @(RSL14a1)@ In languages where method overloading is supported, the first argument should also accept a @Message@ object (which must contain a populated @serial@ field)
414
+
** @(RSL14b)@ The SDK must send a GET request to the endpoint @/channels/{channelName}/messages/{serial}/versions@
415
+
** @(RSL14c)@ Returns a @PaginatedResult<Message>@
384
416
385
417
h3(#plugins). Plugins
386
418
* @(PC1)@ Specific client library features that are not commonly used may be supplied as independent libraries, as plugins, in order to avoid excessively bloating the client library. Although such plugins are packaged as independent libraries, they are still considered logically to be part of the client library code and, as such, may be tightly coupled with the client library implementation. The client library can be assumed to be aware of the plugin specific type and capabilities, and such plugins may by design be coupled to a specific version of the client library.
0 commit comments