mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
feat(ffi): install, list, enable and call modules
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d21bd8028
commit
1027ef6161
13 files changed
+1545
-86
No files matched your search
@@ -7,8 +7,8 @@ import '../frb_generated.dart';
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
// These functions are ignored because they are not marked as `pub`: `new`
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_fields_are_eq`, `assert_fields_are_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`
|
||||
// These functions are ignored because they are not marked as `pub`: `new`, `new`
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_fields_are_eq`, `assert_fields_are_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`
|
||||
|
||||
class AssetDto {
|
||||
final String hash;
|
||||
@@ -505,6 +505,95 @@ class LegacyCandidate {
|
||||
preselected == other.preselected;
|
||||
}
|
||||
|
||||
/// An installed (or inspected) module.
|
||||
class ModuleDto {
|
||||
final String id;
|
||||
final String name;
|
||||
final String version;
|
||||
final String description;
|
||||
final String author;
|
||||
|
||||
/// `storage`, `crypto`, `clipboard`, `pages:read`, `pages:write`.
|
||||
final List<String> permissions;
|
||||
final List<ModuleViewDto> views;
|
||||
|
||||
/// Block macros (`{{name args}}`) it renders.
|
||||
final List<String> macros;
|
||||
|
||||
/// How often the app sends it a `tick` request, if at all.
|
||||
final int? tickSeconds;
|
||||
final bool enabled;
|
||||
|
||||
/// Size of the module file in bytes.
|
||||
final BigInt size;
|
||||
|
||||
const ModuleDto({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.version,
|
||||
required this.description,
|
||||
required this.author,
|
||||
required this.permissions,
|
||||
required this.views,
|
||||
required this.macros,
|
||||
this.tickSeconds,
|
||||
required this.enabled,
|
||||
required this.size,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
id.hashCode ^
|
||||
name.hashCode ^
|
||||
version.hashCode ^
|
||||
description.hashCode ^
|
||||
author.hashCode ^
|
||||
permissions.hashCode ^
|
||||
views.hashCode ^
|
||||
macros.hashCode ^
|
||||
tickSeconds.hashCode ^
|
||||
enabled.hashCode ^
|
||||
size.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ModuleDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
version == other.version &&
|
||||
description == other.description &&
|
||||
author == other.author &&
|
||||
permissions == other.permissions &&
|
||||
views == other.views &&
|
||||
macros == other.macros &&
|
||||
tickSeconds == other.tickSeconds &&
|
||||
enabled == other.enabled &&
|
||||
size == other.size;
|
||||
}
|
||||
|
||||
/// A view a module adds to the sidebar.
|
||||
class ModuleViewDto {
|
||||
final String id;
|
||||
final String title;
|
||||
final String? icon;
|
||||
|
||||
const ModuleViewDto({required this.id, required this.title, this.icon});
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode ^ title.hashCode ^ icon.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ModuleViewDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
title == other.title &&
|
||||
icon == other.icon;
|
||||
}
|
||||
|
||||
/// A level of a namespace (`A/B` under `A`); `id` is `None` when only deeper pages exist.
|
||||
class NamespaceEntry {
|
||||
final String title;
|
||||
|
||||
@@ -92,6 +92,15 @@ abstract class SynapseGraph implements RustOpaqueInterface {
|
||||
required String content,
|
||||
});
|
||||
|
||||
/// Reads and validates a module file without installing it (for the consent dialog).
|
||||
Future<ModuleDto> inspectModule({required List<int> wasm});
|
||||
|
||||
/// Installs or updates a module; `granted` must list every permission it asks for.
|
||||
Future<ModuleDto> installModule({
|
||||
required List<int> wasm,
|
||||
required List<String> granted,
|
||||
});
|
||||
|
||||
/// The journal of `date` (created if missing).
|
||||
Future<PageData> journal({required String date});
|
||||
|
||||
@@ -120,6 +129,12 @@ abstract class SynapseGraph implements RustOpaqueInterface {
|
||||
/// block's slot when `into` is its parent, otherwise they become last children of `into`.
|
||||
Future<List<BlockDto>> mergeBlock({required String id, required String into});
|
||||
|
||||
/// Sends a JSON request to a module and returns its JSON response.
|
||||
Future<String> moduleCall({required String id, required String request});
|
||||
|
||||
/// Installed modules, by name.
|
||||
Future<List<ModuleDto>> modules();
|
||||
|
||||
/// Moves a block with its subtree (drag and drop), possibly to another page.
|
||||
Future<List<BlockDto>> moveBlock({
|
||||
required String id,
|
||||
@@ -218,6 +233,8 @@ abstract class SynapseGraph implements RustOpaqueInterface {
|
||||
required String description,
|
||||
});
|
||||
|
||||
Future<void> setModuleEnabled({required String id, required bool enabled});
|
||||
|
||||
/// Replaces the tags of a page (names only, stored sorted). Journals and templates cannot
|
||||
/// be tagged.
|
||||
Future<PageDto> setPageTags({
|
||||
@@ -232,6 +249,9 @@ abstract class SynapseGraph implements RustOpaqueInterface {
|
||||
/// Sets (or with `None` clears) the emoji of a type, defining the type if needed.
|
||||
Future<void> setTypeIcon({required String name, String? icon});
|
||||
|
||||
/// Stops a module's running instance (dropping its in-memory state).
|
||||
Future<void> stopModule({required String id});
|
||||
|
||||
/// Every tag in use (listed or implied by a type) with its number of pages, most used first.
|
||||
Future<List<TagDto>> tagCatalog();
|
||||
|
||||
@@ -245,6 +265,10 @@ abstract class SynapseGraph implements RustOpaqueInterface {
|
||||
/// not used yet; each with its icon.
|
||||
Future<List<TagDto>> typeCatalog();
|
||||
|
||||
/// Removes a module from this device; `delete_data` also deletes its synced data on every
|
||||
/// device.
|
||||
Future<void> uninstallModule({required String id, required bool deleteData});
|
||||
|
||||
/// Replaces a block's Markdown (the debounced save while typing).
|
||||
Future<void> updateBlock({required String id, required String content});
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
String get codegenVersion => '2.13.0';
|
||||
|
||||
@override
|
||||
int get rustContentHash => 272705018;
|
||||
int get rustContentHash => -821319892;
|
||||
|
||||
static const kDefaultExternalLibraryLoaderConfig =
|
||||
ExternalLibraryLoaderConfig(
|
||||
@@ -220,6 +220,17 @@ abstract class RustLibApi extends BaseApi {
|
||||
required String content,
|
||||
});
|
||||
|
||||
Future<ModuleDto> crateApiGraphSynapseGraphInspectModule({
|
||||
required SynapseGraph that,
|
||||
required List<int> wasm,
|
||||
});
|
||||
|
||||
Future<ModuleDto> crateApiGraphSynapseGraphInstallModule({
|
||||
required SynapseGraph that,
|
||||
required List<int> wasm,
|
||||
required List<String> granted,
|
||||
});
|
||||
|
||||
Future<PageData> crateApiGraphSynapseGraphJournal({
|
||||
required SynapseGraph that,
|
||||
required String date,
|
||||
@@ -253,6 +264,16 @@ abstract class RustLibApi extends BaseApi {
|
||||
required String into,
|
||||
});
|
||||
|
||||
Future<String> crateApiGraphSynapseGraphModuleCall({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required String request,
|
||||
});
|
||||
|
||||
Future<List<ModuleDto>> crateApiGraphSynapseGraphModules({
|
||||
required SynapseGraph that,
|
||||
});
|
||||
|
||||
Future<List<BlockDto>> crateApiGraphSynapseGraphMoveBlock({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
@@ -396,6 +417,12 @@ abstract class RustLibApi extends BaseApi {
|
||||
required String description,
|
||||
});
|
||||
|
||||
Future<void> crateApiGraphSynapseGraphSetModuleEnabled({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required bool enabled,
|
||||
});
|
||||
|
||||
Future<PageDto> crateApiGraphSynapseGraphSetPageTags({
|
||||
required SynapseGraph that,
|
||||
required String pageId,
|
||||
@@ -414,6 +441,11 @@ abstract class RustLibApi extends BaseApi {
|
||||
String? icon,
|
||||
});
|
||||
|
||||
Future<void> crateApiGraphSynapseGraphStopModule({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
});
|
||||
|
||||
Future<List<TagDto>> crateApiGraphSynapseGraphTagCatalog({
|
||||
required SynapseGraph that,
|
||||
});
|
||||
@@ -430,6 +462,12 @@ abstract class RustLibApi extends BaseApi {
|
||||
required SynapseGraph that,
|
||||
});
|
||||
|
||||
Future<void> crateApiGraphSynapseGraphUninstallModule({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required bool deleteData,
|
||||
});
|
||||
|
||||
Future<void> crateApiGraphSynapseGraphUpdateBlock({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
@@ -1455,6 +1493,84 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that", "pageId", "place", "content"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<ModuleDto> crateApiGraphSynapseGraphInspectModule({
|
||||
required SynapseGraph that,
|
||||
required List<int> wasm,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_list_prim_u_8_loose(wasm, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 27,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_module_dto,
|
||||
decodeErrorData: sse_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphInspectModuleConstMeta,
|
||||
argValues: [that, wasm],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphInspectModuleConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_inspect_module",
|
||||
argNames: ["that", "wasm"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<ModuleDto> crateApiGraphSynapseGraphInstallModule({
|
||||
required SynapseGraph that,
|
||||
required List<int> wasm,
|
||||
required List<String> granted,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_list_prim_u_8_loose(wasm, serializer);
|
||||
sse_encode_list_String(granted, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 28,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_module_dto,
|
||||
decodeErrorData: sse_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphInstallModuleConstMeta,
|
||||
argValues: [that, wasm, granted],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphInstallModuleConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_install_module",
|
||||
argNames: ["that", "wasm", "granted"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PageData> crateApiGraphSynapseGraphJournal({
|
||||
required SynapseGraph that,
|
||||
@@ -1472,7 +1588,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 27,
|
||||
funcId: 29,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1510,7 +1626,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 28,
|
||||
funcId: 30,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1550,7 +1666,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 29,
|
||||
funcId: 31,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1586,7 +1702,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 30,
|
||||
funcId: 32,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1628,7 +1744,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 31,
|
||||
funcId: 33,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1668,7 +1784,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 32,
|
||||
funcId: 34,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1689,6 +1805,82 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that", "id", "into"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<String> crateApiGraphSynapseGraphModuleCall({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required String request,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_String(id, serializer);
|
||||
sse_encode_String(request, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 35,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_String,
|
||||
decodeErrorData: sse_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphModuleCallConstMeta,
|
||||
argValues: [that, id, request],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphModuleCallConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_module_call",
|
||||
argNames: ["that", "id", "request"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<ModuleDto>> crateApiGraphSynapseGraphModules({
|
||||
required SynapseGraph that,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 36,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_list_module_dto,
|
||||
decodeErrorData: null,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphModulesConstMeta,
|
||||
argValues: [that],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphModulesConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_modules",
|
||||
argNames: ["that"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<BlockDto>> crateApiGraphSynapseGraphMoveBlock({
|
||||
required SynapseGraph that,
|
||||
@@ -1710,7 +1902,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 33,
|
||||
funcId: 37,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1741,7 +1933,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 34,
|
||||
funcId: 38,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1777,7 +1969,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 35,
|
||||
funcId: 39,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1815,7 +2007,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 36,
|
||||
funcId: 40,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1853,7 +2045,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 37,
|
||||
funcId: 41,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1891,7 +2083,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 38,
|
||||
funcId: 42,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1929,7 +2121,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 39,
|
||||
funcId: 43,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -1967,7 +2159,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 40,
|
||||
funcId: 44,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2005,7 +2197,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 41,
|
||||
funcId: 45,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2043,7 +2235,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 42,
|
||||
funcId: 46,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2085,7 +2277,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 43,
|
||||
funcId: 47,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2125,7 +2317,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 44,
|
||||
funcId: 48,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2165,7 +2357,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 45,
|
||||
funcId: 49,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2205,7 +2397,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 46,
|
||||
funcId: 50,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2243,7 +2435,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 47,
|
||||
funcId: 51,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2283,7 +2475,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 48,
|
||||
funcId: 52,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2323,7 +2515,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 49,
|
||||
funcId: 53,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2361,7 +2553,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 50,
|
||||
funcId: 54,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2399,7 +2591,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 51,
|
||||
funcId: 55,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2439,7 +2631,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 52,
|
||||
funcId: 56,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2479,7 +2671,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 53,
|
||||
funcId: 57,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2519,7 +2711,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 54,
|
||||
funcId: 58,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2559,7 +2751,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 55,
|
||||
funcId: 59,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2599,7 +2791,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 56,
|
||||
funcId: 60,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2639,7 +2831,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 57,
|
||||
funcId: 61,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2679,7 +2871,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 58,
|
||||
funcId: 62,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2700,6 +2892,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that", "hubId", "description"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> crateApiGraphSynapseGraphSetModuleEnabled({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required bool enabled,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_String(id, serializer);
|
||||
sse_encode_bool(enabled, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 63,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_unit,
|
||||
decodeErrorData: sse_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphSetModuleEnabledConstMeta,
|
||||
argValues: [that, id, enabled],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphSetModuleEnabledConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_set_module_enabled",
|
||||
argNames: ["that", "id", "enabled"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PageDto> crateApiGraphSynapseGraphSetPageTags({
|
||||
required SynapseGraph that,
|
||||
@@ -2719,7 +2951,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 59,
|
||||
funcId: 64,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2759,7 +2991,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 60,
|
||||
funcId: 65,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2799,7 +3031,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 61,
|
||||
funcId: 66,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2820,6 +3052,44 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that", "name", "icon"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> crateApiGraphSynapseGraphStopModule({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_String(id, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 67,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_unit,
|
||||
decodeErrorData: null,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphStopModuleConstMeta,
|
||||
argValues: [that, id],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphStopModuleConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_stop_module",
|
||||
argNames: ["that", "id"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<TagDto>> crateApiGraphSynapseGraphTagCatalog({
|
||||
required SynapseGraph that,
|
||||
@@ -2835,7 +3105,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 62,
|
||||
funcId: 68,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2875,7 +3145,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 63,
|
||||
funcId: 69,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2906,7 +3176,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 64)!;
|
||||
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 70)!;
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_String,
|
||||
@@ -2937,7 +3207,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 65,
|
||||
funcId: 71,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -2958,6 +3228,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> crateApiGraphSynapseGraphUninstallModule({
|
||||
required SynapseGraph that,
|
||||
required String id,
|
||||
required bool deleteData,
|
||||
}) {
|
||||
return handler.executeNormal(
|
||||
NormalTask(
|
||||
callFfi: (port_) {
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerSynapseGraph(
|
||||
that,
|
||||
serializer,
|
||||
);
|
||||
sse_encode_String(id, serializer);
|
||||
sse_encode_bool(deleteData, serializer);
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 72,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
codec: SseCodec(
|
||||
decodeSuccessData: sse_decode_unit,
|
||||
decodeErrorData: sse_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kCrateApiGraphSynapseGraphUninstallModuleConstMeta,
|
||||
argValues: [that, id, deleteData],
|
||||
apiImpl: this,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateApiGraphSynapseGraphUninstallModuleConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: "SynapseGraph_uninstall_module",
|
||||
argNames: ["that", "id", "deleteData"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> crateApiGraphSynapseGraphUpdateBlock({
|
||||
required SynapseGraph that,
|
||||
@@ -2977,7 +3287,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pdeCallFfi(
|
||||
generalizedFrbRustBinding,
|
||||
serializer,
|
||||
funcId: 66,
|
||||
funcId: 73,
|
||||
port: port_,
|
||||
);
|
||||
},
|
||||
@@ -3372,6 +3682,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (raw as List<dynamic>).map(dco_decode_legacy_candidate).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
List<ModuleDto> dco_decode_list_module_dto(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return (raw as List<dynamic>).map(dco_decode_module_dto).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> dco_decode_list_module_view_dto(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return (raw as List<dynamic>).map(dco_decode_module_view_dto).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> dco_decode_list_namespace_entry(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -3456,6 +3778,40 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (raw as List<dynamic>).map(dco_decode_title_hit).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
ModuleDto dco_decode_module_dto(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.length != 11)
|
||||
throw Exception('unexpected arr length: expect 11 but see ${arr.length}');
|
||||
return ModuleDto(
|
||||
id: dco_decode_String(arr[0]),
|
||||
name: dco_decode_String(arr[1]),
|
||||
version: dco_decode_String(arr[2]),
|
||||
description: dco_decode_String(arr[3]),
|
||||
author: dco_decode_String(arr[4]),
|
||||
permissions: dco_decode_list_String(arr[5]),
|
||||
views: dco_decode_list_module_view_dto(arr[6]),
|
||||
macros: dco_decode_list_String(arr[7]),
|
||||
tickSeconds: dco_decode_opt_box_autoadd_u_32(arr[8]),
|
||||
enabled: dco_decode_bool(arr[9]),
|
||||
size: dco_decode_u_64(arr[10]),
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
ModuleViewDto dco_decode_module_view_dto(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.length != 3)
|
||||
throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
|
||||
return ModuleViewDto(
|
||||
id: dco_decode_String(arr[0]),
|
||||
title: dco_decode_String(arr[1]),
|
||||
icon: dco_decode_opt_String(arr[2]),
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
NamespaceEntry dco_decode_namespace_entry(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -4141,6 +4497,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
List<ModuleDto> sse_decode_list_module_dto(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
var len_ = sse_decode_i_32(deserializer);
|
||||
var ans_ = <ModuleDto>[];
|
||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||
ans_.add(sse_decode_module_dto(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> sse_decode_list_module_view_dto(
|
||||
SseDeserializer deserializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
var len_ = sse_decode_i_32(deserializer);
|
||||
var ans_ = <ModuleViewDto>[];
|
||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||
ans_.add(sse_decode_module_view_dto(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> sse_decode_list_namespace_entry(
|
||||
SseDeserializer deserializer,
|
||||
@@ -4283,6 +4665,44 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
ModuleDto sse_decode_module_dto(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var var_id = sse_decode_String(deserializer);
|
||||
var var_name = sse_decode_String(deserializer);
|
||||
var var_version = sse_decode_String(deserializer);
|
||||
var var_description = sse_decode_String(deserializer);
|
||||
var var_author = sse_decode_String(deserializer);
|
||||
var var_permissions = sse_decode_list_String(deserializer);
|
||||
var var_views = sse_decode_list_module_view_dto(deserializer);
|
||||
var var_macros = sse_decode_list_String(deserializer);
|
||||
var var_tickSeconds = sse_decode_opt_box_autoadd_u_32(deserializer);
|
||||
var var_enabled = sse_decode_bool(deserializer);
|
||||
var var_size = sse_decode_u_64(deserializer);
|
||||
return ModuleDto(
|
||||
id: var_id,
|
||||
name: var_name,
|
||||
version: var_version,
|
||||
description: var_description,
|
||||
author: var_author,
|
||||
permissions: var_permissions,
|
||||
views: var_views,
|
||||
macros: var_macros,
|
||||
tickSeconds: var_tickSeconds,
|
||||
enabled: var_enabled,
|
||||
size: var_size,
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
ModuleViewDto sse_decode_module_view_dto(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var var_id = sse_decode_String(deserializer);
|
||||
var var_title = sse_decode_String(deserializer);
|
||||
var var_icon = sse_decode_opt_String(deserializer);
|
||||
return ModuleViewDto(id: var_id, title: var_title, icon: var_icon);
|
||||
}
|
||||
|
||||
@protected
|
||||
NamespaceEntry sse_decode_namespace_entry(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -4922,6 +5342,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_dto(
|
||||
List<ModuleDto> self,
|
||||
SseSerializer serializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_i_32(self.length, serializer);
|
||||
for (final item in self) {
|
||||
sse_encode_module_dto(item, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_view_dto(
|
||||
List<ModuleViewDto> self,
|
||||
SseSerializer serializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_i_32(self.length, serializer);
|
||||
for (final item in self) {
|
||||
sse_encode_module_view_dto(item, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_namespace_entry(
|
||||
List<NamespaceEntry> self,
|
||||
@@ -5078,6 +5522,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_module_dto(ModuleDto self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_String(self.id, serializer);
|
||||
sse_encode_String(self.name, serializer);
|
||||
sse_encode_String(self.version, serializer);
|
||||
sse_encode_String(self.description, serializer);
|
||||
sse_encode_String(self.author, serializer);
|
||||
sse_encode_list_String(self.permissions, serializer);
|
||||
sse_encode_list_module_view_dto(self.views, serializer);
|
||||
sse_encode_list_String(self.macros, serializer);
|
||||
sse_encode_opt_box_autoadd_u_32(self.tickSeconds, serializer);
|
||||
sse_encode_bool(self.enabled, serializer);
|
||||
sse_encode_u_64(self.size, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_module_view_dto(
|
||||
ModuleViewDto self,
|
||||
SseSerializer serializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_String(self.id, serializer);
|
||||
sse_encode_String(self.title, serializer);
|
||||
sse_encode_opt_String(self.icon, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_namespace_entry(
|
||||
NamespaceEntry self,
|
||||
@@ -5494,6 +5965,22 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
|
||||
content: content,
|
||||
);
|
||||
|
||||
/// Reads and validates a module file without installing it (for the consent dialog).
|
||||
Future<ModuleDto> inspectModule({required List<int> wasm}) => RustLib
|
||||
.instance
|
||||
.api
|
||||
.crateApiGraphSynapseGraphInspectModule(that: this, wasm: wasm);
|
||||
|
||||
/// Installs or updates a module; `granted` must list every permission it asks for.
|
||||
Future<ModuleDto> installModule({
|
||||
required List<int> wasm,
|
||||
required List<String> granted,
|
||||
}) => RustLib.instance.api.crateApiGraphSynapseGraphInstallModule(
|
||||
that: this,
|
||||
wasm: wasm,
|
||||
granted: granted,
|
||||
);
|
||||
|
||||
/// The journal of `date` (created if missing).
|
||||
Future<PageData> journal({required String date}) => RustLib.instance.api
|
||||
.crateApiGraphSynapseGraphJournal(that: this, date: date);
|
||||
@@ -5544,6 +6031,18 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
|
||||
into: into,
|
||||
);
|
||||
|
||||
/// Sends a JSON request to a module and returns its JSON response.
|
||||
Future<String> moduleCall({required String id, required String request}) =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphModuleCall(
|
||||
that: this,
|
||||
id: id,
|
||||
request: request,
|
||||
);
|
||||
|
||||
/// Installed modules, by name.
|
||||
Future<List<ModuleDto>> modules() =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphModules(that: this);
|
||||
|
||||
/// Moves a block with its subtree (drag and drop), possibly to another page.
|
||||
Future<List<BlockDto>> moveBlock({
|
||||
required String id,
|
||||
@@ -5719,6 +6218,13 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
|
||||
description: description,
|
||||
);
|
||||
|
||||
Future<void> setModuleEnabled({required String id, required bool enabled}) =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphSetModuleEnabled(
|
||||
that: this,
|
||||
id: id,
|
||||
enabled: enabled,
|
||||
);
|
||||
|
||||
/// Replaces the tags of a page (names only, stored sorted). Journals and templates cannot
|
||||
/// be tagged.
|
||||
Future<PageDto> setPageTags({
|
||||
@@ -5745,6 +6251,10 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
|
||||
.api
|
||||
.crateApiGraphSynapseGraphSetTypeIcon(that: this, name: name, icon: icon);
|
||||
|
||||
/// Stops a module's running instance (dropping its in-memory state).
|
||||
Future<void> stopModule({required String id}) => RustLib.instance.api
|
||||
.crateApiGraphSynapseGraphStopModule(that: this, id: id);
|
||||
|
||||
/// Every tag in use (listed or implied by a type) with its number of pages, most used first.
|
||||
Future<List<TagDto>> tagCatalog() =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphTagCatalog(that: this);
|
||||
@@ -5766,6 +6276,17 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
|
||||
Future<List<TagDto>> typeCatalog() =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphTypeCatalog(that: this);
|
||||
|
||||
/// Removes a module from this device; `delete_data` also deletes its synced data on every
|
||||
/// device.
|
||||
Future<void> uninstallModule({
|
||||
required String id,
|
||||
required bool deleteData,
|
||||
}) => RustLib.instance.api.crateApiGraphSynapseGraphUninstallModule(
|
||||
that: this,
|
||||
id: id,
|
||||
deleteData: deleteData,
|
||||
);
|
||||
|
||||
/// Replaces a block's Markdown (the debounced save while typing).
|
||||
Future<void> updateBlock({required String id, required String content}) =>
|
||||
RustLib.instance.api.crateApiGraphSynapseGraphUpdateBlock(
|
||||
|
||||
@@ -160,6 +160,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<LegacyCandidate> dco_decode_list_legacy_candidate(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<ModuleDto> dco_decode_list_module_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> dco_decode_list_module_view_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> dco_decode_list_namespace_entry(dynamic raw);
|
||||
|
||||
@@ -202,6 +208,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<TitleHit> dco_decode_list_title_hit(dynamic raw);
|
||||
|
||||
@protected
|
||||
ModuleDto dco_decode_module_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
ModuleViewDto dco_decode_module_view_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
NamespaceEntry dco_decode_namespace_entry(dynamic raw);
|
||||
|
||||
@@ -406,6 +418,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
SseDeserializer deserializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
List<ModuleDto> sse_decode_list_module_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> sse_decode_list_module_view_dto(
|
||||
SseDeserializer deserializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> sse_decode_list_namespace_entry(
|
||||
SseDeserializer deserializer,
|
||||
@@ -452,6 +472,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<TitleHit> sse_decode_list_title_hit(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ModuleDto sse_decode_module_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ModuleViewDto sse_decode_module_view_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
NamespaceEntry sse_decode_namespace_entry(SseDeserializer deserializer);
|
||||
|
||||
@@ -683,6 +709,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_dto(
|
||||
List<ModuleDto> self,
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_view_dto(
|
||||
List<ModuleViewDto> self,
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_namespace_entry(
|
||||
List<NamespaceEntry> self,
|
||||
@@ -752,6 +790,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_list_title_hit(List<TitleHit> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_module_dto(ModuleDto self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_module_view_dto(ModuleViewDto self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_namespace_entry(
|
||||
NamespaceEntry self,
|
||||
|
||||
@@ -162,6 +162,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<LegacyCandidate> dco_decode_list_legacy_candidate(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<ModuleDto> dco_decode_list_module_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> dco_decode_list_module_view_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> dco_decode_list_namespace_entry(dynamic raw);
|
||||
|
||||
@@ -204,6 +210,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<TitleHit> dco_decode_list_title_hit(dynamic raw);
|
||||
|
||||
@protected
|
||||
ModuleDto dco_decode_module_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
ModuleViewDto dco_decode_module_view_dto(dynamic raw);
|
||||
|
||||
@protected
|
||||
NamespaceEntry dco_decode_namespace_entry(dynamic raw);
|
||||
|
||||
@@ -408,6 +420,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
SseDeserializer deserializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
List<ModuleDto> sse_decode_list_module_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<ModuleViewDto> sse_decode_list_module_view_dto(
|
||||
SseDeserializer deserializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
List<NamespaceEntry> sse_decode_list_namespace_entry(
|
||||
SseDeserializer deserializer,
|
||||
@@ -454,6 +474,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<TitleHit> sse_decode_list_title_hit(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ModuleDto sse_decode_module_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ModuleViewDto sse_decode_module_view_dto(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
NamespaceEntry sse_decode_namespace_entry(SseDeserializer deserializer);
|
||||
|
||||
@@ -685,6 +711,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_dto(
|
||||
List<ModuleDto> self,
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_module_view_dto(
|
||||
List<ModuleViewDto> self,
|
||||
SseSerializer serializer,
|
||||
);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_namespace_entry(
|
||||
List<NamespaceEntry> self,
|
||||
@@ -754,6 +792,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_list_title_hit(List<TitleHit> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_module_dto(ModuleDto self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_module_view_dto(ModuleViewDto self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_namespace_entry(
|
||||
NamespaceEntry self,
|
||||
|
||||
Reference in new issue
Block a user