Skip to content

Commit

Permalink
Add web socket ticket capability
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Sep 23, 2024
1 parent f55a186 commit 6b3eccb
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## [0.2.1] - 2024-09-16
## [0.2.3] - 2024-09-16
- Add web socket ticket capability

## [0.2.2] - 2024-09-16
- Add X-JMAP-Identity header

## [0.2.1] - 2024-08-28
Expand Down
2 changes: 2 additions & 0 deletions lib/http/converter/capabilities_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:jmap_dart_client/jmap/core/capability/mail_capability.dart';
import 'package:jmap_dart_client/jmap/core/capability/mdn_capability.dart';
import 'package:jmap_dart_client/jmap/core/capability/submission_capability.dart';
import 'package:jmap_dart_client/jmap/core/capability/vacation_capability.dart';
import 'package:jmap_dart_client/jmap/core/capability/web_socket_ticket_capability.dart';
import 'package:jmap_dart_client/jmap/core/capability/websocket_capability.dart';

class CapabilitiesConverter {
Expand All @@ -26,6 +27,7 @@ class CapabilitiesConverter {
CapabilityIdentifier.jamesCalendarEvent: CalendarEventCapability.deserialize,
CapabilityIdentifier.jmapVacationResponse: VacationCapability.deserialize,
CapabilityIdentifier.jmapWebSocket: WebSocketCapability.deserialize,
CapabilityIdentifier.jmapWebSocketTicket: WebSocketTicketCapability.deserialize,
CapabilityIdentifier.jmapMdn: MdnCapability.deserialize
});
}
Expand Down
1 change: 1 addition & 0 deletions lib/jmap/core/capability/capability_identifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CapabilityIdentifier with EquatableMixin {
static final jmapSubmission = CapabilityIdentifier(Uri.parse('urn:ietf:params:jmap:submission'));
static final jmapVacationResponse = CapabilityIdentifier(Uri.parse('urn:ietf:params:jmap:vacationresponse'));
static final jmapWebSocket = CapabilityIdentifier(Uri.parse('urn:ietf:params:jmap:websocket'));
static final jmapWebSocketTicket = CapabilityIdentifier(Uri.parse('com:linagora:params:jmap:ws:ticket'));
static final jmapMdn = CapabilityIdentifier(Uri.parse('urn:ietf:params:jmap:mdn'));
static final jmapQuota = CapabilityIdentifier(Uri.parse('urn:ietf:params:jmap:quota'));
static final jmapTeamMailboxes = CapabilityIdentifier(Uri.parse('urn:apache:james:params:jmap:mail:shares'));
Expand Down
21 changes: 21 additions & 0 deletions lib/jmap/core/capability/web_socket_ticket_capability.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:jmap_dart_client/jmap/core/capability/capability_properties.dart';
import 'package:json_annotation/json_annotation.dart';

part 'web_socket_ticket_capability.g.dart';

@JsonSerializable(explicitToJson: true, includeIfNull: false)
class WebSocketTicketCapability extends CapabilityProperties {
final Uri? generationEndpoint;
final Uri? revocationEndpoint;

WebSocketTicketCapability({required this.generationEndpoint, required this.revocationEndpoint});

factory WebSocketTicketCapability.fromJson(Map<String, dynamic> json) => _$WebSocketTicketCapabilityFromJson(json);

Map<String, dynamic> toJson() => _$WebSocketTicketCapabilityToJson(this);

static WebSocketTicketCapability deserialize(Map<String, dynamic> json) => WebSocketTicketCapability.fromJson(json);

@override
List<Object?> get props => [generationEndpoint, revocationEndpoint];
}
33 changes: 33 additions & 0 deletions lib/jmap/core/capability/web_socket_ticket_capability.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jmap_dart_client
description: A JMAP client library to make JMAP method calls and process the responses.
version: 0.2.2
version: 0.2.3
homepage: https://github.com/linagora/jmap-dart-client.git

environment:
Expand Down

0 comments on commit 6b3eccb

Please sign in to comment.