Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVEXP-375: Enhance DX for ttl field in SendMessageRequest #56

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update field comment to reflect the SDK capability
asein-sinch committed Apr 11, 2024
commit 8b6d0d578f52d63f86af231a9dfd5cbe0c500850
Original file line number Diff line number Diff line change
@@ -35,9 +35,13 @@ export interface SendMessageRequestBase<T extends Recipient> {
queue?: MessageQueue;
/** @see Recipient */
recipient: T;
/** The timeout allotted for sending the message, expressed in seconds. Passed to channels which support it and emulated by the Conversation API for channels without ttl support but with message retract/unsend functionality. Channel failover will not be performed for messages with an expired TTL. The format is an integer with the suffix `s` (for seconds). Valid integer range is 3 to 315,576,000,000 (inclusive). Example values include `10s` (10 seconds) and `86400s` (24 hours). */
/** The timeout allotted for sending the message, expressed in seconds. Passed to channels which support it and emulated by the Conversation API for channels without ttl support but with message retract/unsend functionality. Channel failover will not be performed for messages with an expired TTL.
*
* The format is an integer with the suffix `s` (for seconds). Valid integer range is 3 to 315,576,000,000 (inclusive). Example values include `10s` (10 seconds) and `86400s` (24 hours).
* The SDK will take care of the formatting: example of valid input for 10 seconds: 10 (number), "10" (string), "10s" (string)
*/
ttl?: string | number;
/** Overrides the app\'s [Processing Mode](../../../../../conversation/processing-modes/). Default value is `DEFAULT`. */
/** Overrides the app's [Processing Mode](../../../../../conversation/processing-modes/). Default value is `DEFAULT`. */
processing_strategy?: ProcessingStrategy;
/** An arbitrary identifier that will be propagated to callbacks related to this message, including MO replies. Only applicable to messages sent with the `CONVERSATION` processing mode. Up to 128 characters long. */
correlation_id?: string;

Unchanged files with check annotations Beta

}
performSendMessageRequestBodyTransformation(
body: SendMessageRequest<Recipient>

Check warning on line 384 in packages/conversation/src/rest/v1/messages/messages-api.ts

GitHub Actions / build (18.x)

Missing trailing comma

Check warning on line 384 in packages/conversation/src/rest/v1/messages/messages-api.ts

GitHub Actions / build (20.x)

Missing trailing comma
): SendMessageRequest<Recipient> {
const requestDataBody = { ...body };
// 'ttl' field can be a number or a string and needs to be formatted as for instance "10s" to be accepted by the server