Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
83 changes: 42 additions & 41 deletions apipod/apipod_client/lib/src/protocol/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ import 'package:apipod_client/src/protocol/nip05/nip_05_response_spy.dart'
as _i7;
import 'package:apipod_client/src/protocol/nip05/check_name_result_spy.dart'
as _i8;
import 'package:apipod_client/src/protocol/nostr_band/nostr_band_hashtags.dart'
as _i9;
import 'package:apipod_client/src/protocol/nostr_band/nostr_band_people.dart'
as _i10;
import 'package:ndk/data_layer/models/nip_01_event_model.dart' as _i11;
import 'protocol.dart' as _i12;
import 'package:ndk/data_layer/models/nip_01_event_model.dart' as _i9;
import 'package:apipod_client/src/protocol/trends/trends_response.dart' as _i10;
import 'protocol.dart' as _i11;

/// {@category Endpoint}
class EndpointAppUpdate extends _i1.EndpointRef {
Expand Down Expand Up @@ -140,33 +137,6 @@ class EndpointNip05 extends _i1.EndpointRef {
);
}

/// {@category Endpoint}
class EndpointNostrBand extends _i1.EndpointRef {
EndpointNostrBand(_i1.EndpointCaller caller) : super(caller);

@override
String get name => 'nostrBand';

_i2.Future<_i9.NostrBandHashtags> hashtags({
String? lang,
String? limit,
}) => caller.callServerEndpoint<_i9.NostrBandHashtags>(
'nostrBand',
'hashtags',
{
'lang': lang,
'limit': limit,
},
);

_i2.Future<_i10.NostrBandPeople> profiles({String? limit}) =>
caller.callServerEndpoint<_i10.NostrBandPeople>(
'nostrBand',
'profiles',
{'limit': limit},
);
}

/// {@category Endpoint}
class EndpointOtsoExternalSync extends _i1.EndpointRef {
EndpointOtsoExternalSync(_i1.EndpointCaller caller) : super(caller);
Expand All @@ -184,7 +154,7 @@ class EndpointNostrPush extends _i1.EndpointRef {

_i2.Future<bool> register(
String token,
List<_i11.Nip01EventModel> events,
List<_i9.Nip01EventModel> events,
) => caller.callServerEndpoint<bool>(
'nostrPush',
'register',
Expand All @@ -195,7 +165,6 @@ class EndpointNostrPush extends _i1.EndpointRef {
);

/// Get the registration state for a public key with signature verification
/// The event must be signed by the pubKey and contain the pubKey to verify
_i2.Future<Map<String, dynamic>> getRegistrationState(
String signedEventJson,
) => caller.callServerEndpoint<Map<String, dynamic>>(
Expand All @@ -212,14 +181,46 @@ class EndpointOtsoPush extends _i1.EndpointRef {
@override
String get name => 'otsoPush';

_i2.Future<bool> register(List<_i11.Nip01EventModel> events) =>
_i2.Future<bool> register(List<_i9.Nip01EventModel> events) =>
caller.callServerEndpoint<bool>(
'otsoPush',
'register',
{'events': events},
);
}

/// {@category Endpoint}
class EndpointTrends extends _i1.EndpointRef {
EndpointTrends(_i1.EndpointCaller caller) : super(caller);

@override
String get name => 'trends';

_i2.Future<_i10.TrendsResponse> trends({
required String interval,
required int limit,
}) => caller.callServerEndpoint<_i10.TrendsResponse>(
'trends',
'trends',
{
'interval': interval,
'limit': limit,
},
);

_i2.Future<_i10.TrendsResponse> trendingPeople({
required String interval,
required int limit,
}) => caller.callServerEndpoint<_i10.TrendsResponse>(
'trends',
'trendingPeople',
{
'interval': interval,
'limit': limit,
},
);
}

class Client extends _i1.ServerpodClientShared {
Client(
String host, {
Expand All @@ -240,7 +241,7 @@ class Client extends _i1.ServerpodClientShared {
bool? disconnectStreamsOnLostInternetConnection,
}) : super(
host,
_i12.Protocol(),
_i11.Protocol(),
securityContext: securityContext,
streamingConnectionTimeout: streamingConnectionTimeout,
connectionTimeout: connectionTimeout,
Expand All @@ -253,10 +254,10 @@ class Client extends _i1.ServerpodClientShared {
linkShorter = EndpointLinkShorter(this);
moderation = EndpointModeration(this);
nip05 = EndpointNip05(this);
nostrBand = EndpointNostrBand(this);
otsoExternalSync = EndpointOtsoExternalSync(this);
nostrPush = EndpointNostrPush(this);
otsoPush = EndpointOtsoPush(this);
trends = EndpointTrends(this);
}

late final EndpointAppUpdate appUpdate;
Expand All @@ -267,24 +268,24 @@ class Client extends _i1.ServerpodClientShared {

late final EndpointNip05 nip05;

late final EndpointNostrBand nostrBand;

late final EndpointOtsoExternalSync otsoExternalSync;

late final EndpointNostrPush nostrPush;

late final EndpointOtsoPush otsoPush;

late final EndpointTrends trends;

@override
Map<String, _i1.EndpointRef> get endpointRefLookup => {
'appUpdate': appUpdate,
'linkShorter': linkShorter,
'moderation': moderation,
'nip05': nip05,
'nostrBand': nostrBand,
'otsoExternalSync': otsoExternalSync,
'nostrPush': nostrPush,
'otsoPush': otsoPush,
'trends': trends,
};

@override
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading