Skip to content

Commit

Permalink
'depencency bump, Media2 - DeleteProfile'
Browse files Browse the repository at this point in the history
  • Loading branch information
faithoflifedev committed Oct 21, 2023
1 parent b9c0dd5 commit 6502f7c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.1.3+2

* depencency bump
* Media2
* DeleteProfile

## 2.1.3+1

* workaround for [#53477](https://github.com/flutter/flutter/issues/53477)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To use this package in your code, first add the dependency to your project:
```yml
dependencies:
...
easy_onvif: ^2.1.3+1
easy_onvif: ^2.1.3+2
```
If you need additional help getting started with dart, check out these [guides](https://dart.dev/guides).
Expand Down
6 changes: 3 additions & 3 deletions lib/meta.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// DO NOT EDIT THIS FILE
/// THIS FILE IS AUTOMATICALLY OVER WRITTEN BY PublishTools
// DO NOT EDIT THIS FILE
// THIS FILE IS AUTOMATICALLY OVER WRITTEN BY PublishTools
import 'dart:convert' show json;

final pubSpec = json.decode(
'{"name":"easy_onvif","version":"2.1.3+1","homepage":"https://github.com/faithoflifedev/easy_onvif","environment":{"sdk":">=3.0.0 <4.0.0"},"description":"A pure Dart library designed primarily for command line automation of Onvif compatible devices, but can be used anywhere Dart is used.","dependencies":{"args":"^2.4.2","crypto":"^3.0.3","dio":"^5.3.3","ffi":"^2.1.0","html_unescape":"^2.0.0","intl":"^0.18.1","json_annotation":"^4.8.1","loggy":"^2.0.3","path":"^1.8.3","shelf":"^1.4.1","shelf_router":"^1.1.4","sprintf":"^7.0.0","universal_io":"^2.2.2","uuid":"^3.0.7","xml":"^6.3.0","xml2json":"^6.2.0","yaml":"^3.1.2"},"dev_dependencies":{"build_runner":"^2.4.5","grinder":"^0.9.4","json_serializable":"^6.7.1","lints":"^2.1.1","mustache_template":"^2.0.0","process_run":"^0.13.0","pub_semver":"^2.1.4","publish_tools":"^0.1.0+10","pubspec":"^2.3.0","test":"^1.24.3"},"executables":{"onvif":""},"repository":"https://github.com/faithoflifedev/easy_onvif.git"}');
'{"name":"easy_onvif","version":"2.1.3+2","homepage":"https://github.com/faithoflifedev/easy_onvif","environment":{"sdk":">=3.0.0 <4.0.0"},"description":"A pure Dart library designed primarily for command line automation of Onvif compatible devices, but can be used anywhere Dart is used.","dependencies":{"args":"^2.4.2","crypto":"^3.0.3","dio":"^5.3.3","ffi":"^2.1.0","html_unescape":"^2.0.0","intl":"^0.18.1","json_annotation":"^4.8.1","loggy":"^2.0.3","path":"^1.8.3","shelf":"^1.4.1","shelf_router":"^1.1.4","sprintf":"^7.0.0","universal_io":"^2.2.2","uuid":"^4.1.0","xml":"^6.3.0","xml2json":"^6.2.0","yaml":"^3.1.2"},"dev_dependencies":{"build_runner":"^2.4.5","grinder":"^0.9.4","json_serializable":"^6.7.1","lints":"^3.0.0","mustache_template":"^2.0.0","process_run":"^0.13.0","pub_semver":"^2.1.4","publish_tools":"^0.1.0+12","pubspec":"^2.3.0","test":"^1.24.8"},"executables":{"onvif":""},"repository":"https://github.com/faithoflifedev/easy_onvif.git"}');
2 changes: 1 addition & 1 deletion lib/src/cmd/onvif_probe_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DevicesController {
headers: {'Content-type': 'application/json'},
));

return router;
return router.call;
}
}

Expand Down
16 changes: 16 additions & 0 deletions lib/src/media2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ class Media2 with UiLoggy {
required this.uri,
});

Future<bool> deleteProfile(String referenceToken) async {
loggy.debug('deleteProfile');

final envelope = await transport.sendRequest(
uri,
transport
.securedEnvelope(soap.Media2Request.deleteProfile(referenceToken)));

if (envelope.body.hasFault) {
throw Exception(envelope.body.fault.toString());
}

return envelope.body.response?.containsKey('DeleteProfileResponse') ??
false;
}

Future<MetadataConfigurationOptions> getMetadataConfigurationOptions({
String? configurationToken,
String? profileToken,
Expand Down
12 changes: 12 additions & 0 deletions lib/src/soap/media2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ import 'transport.dart';
import 'xmlns.dart';

class Media2Request {
/// XML for the [deleteProfile]
static XmlDocumentFragment deleteProfile(String referenceToken) {
Transport.builder.element('DeleteProfile', nest: () {
Transport.builder.namespace(Xmlns.tr2);
Transport.builder.element('ReferenceToken', nest: () {
Transport.builder.text(referenceToken);
});
});

return Transport.builder.buildFragment();
}

/// XML for the [getMetadataConfigurationOptions]
static XmlDocumentFragment getMetadataConfigurationOptions(
{String? configurationToken, String? profileToken}) =>
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: easy_onvif
version: 2.1.3+1
version: 2.1.3+2
homepage: https://github.com/faithoflifedev/easy_onvif
description: A pure Dart library designed primarily for command line automation of Onvif compatible devices, but can be used anywhere Dart is used.
repository: https://github.com/faithoflifedev/easy_onvif.git
Expand All @@ -20,20 +20,20 @@ dependencies:
shelf_router: ^1.1.4
sprintf: ^7.0.0
universal_io: ^2.2.2
uuid: ^3.0.7
uuid: ^4.1.0
xml: ^6.3.0
xml2json: ^6.2.0
yaml: ^3.1.2
dev_dependencies:
build_runner: ^2.4.5
grinder: ^0.9.4
json_serializable: ^6.7.1
lints: ^2.1.1
lints: ^3.0.0
mustache_template: ^2.0.0
process_run: ^0.13.0
pub_semver: ^2.1.4
publish_tools: ^0.1.0+10
publish_tools: ^0.1.0+12
pubspec: ^2.3.0
test: ^1.24.3
test: ^1.24.8
executables:
onvif:

0 comments on commit 6502f7c

Please sign in to comment.