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

Add StarterPack things #1837

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
16 changes: 16 additions & 0 deletions packages/bluesky/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release Note

## v0.18.4

- Add endpoints on `GraphService`.
- `starterpack`
- `getActorStarterPacks`
- `getStarterPack`
- `getStarterPacks`
- `searchStarterPacks`
- Add an endpoint on `UnspeccedService`.
- `searchStarterPacksSkeleton`
- Add `starterPacks` property on `ProfileAssociated`.
- Add `joinedViaStarterPack` property on `ProfileRecord`.
- Add `starterPackViewBasic` union on `EmbedViewRecordView`.
- Add `joinedViaStarterPack` and `createdAt` parameters on `ActorService.profile`.
- Expose `EmbedViewRecordViewRecord` from `bluesky.dart` package.

## v0.18.3

- Expose `JwtExtension`.
Expand Down
7 changes: 7 additions & 0 deletions packages/bluesky/lib/app_bsky_graph_defs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/defs/list_item_view.dart';
export 'package:bluesky/src/services/types/app/bsky/graph/defs/starter_pack_view_basic.dart';
export 'package:bluesky/src/services/types/app/bsky/graph/defs/starter_pack_view.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/getActorStarterPacks/output.dart';
5 changes: 5 additions & 0 deletions packages/bluesky/lib/app_bsky_graph_get_starter_pack.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/getStarterPack/output.dart';
5 changes: 5 additions & 0 deletions packages/bluesky/lib/app_bsky_graph_get_starter_packs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/getStarterPacks/output.dart';
5 changes: 5 additions & 0 deletions packages/bluesky/lib/app_bsky_graph_search_starter_packs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/searchStarterPacks/output.dart';
6 changes: 6 additions & 0 deletions packages/bluesky/lib/app_bsky_graph_starterpack.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/graph/starterpack/feed_item.dart';
export 'package:bluesky/src/services/types/app/bsky/graph/starterpack/record.dart';
5 changes: 5 additions & 0 deletions packages/bluesky/lib/app_bsky_unspecced_defs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/unspecced/defs/skeleton_search_starter_pack.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

export 'package:bluesky/src/services/types/app/bsky/unspecced/searchStarterPacksSkeleton/output.dart';
1 change: 1 addition & 0 deletions packages/bluesky/lib/bluesky.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export 'package:bluesky/src/services/entities/feed_interaction.dart';
export 'package:bluesky/src/services/entities/suggestions_skeleton.dart';
export 'package:bluesky/src/services/entities/saved_feed.dart';
export 'package:bluesky/src/services/entities/saved_feeds_pref_v2.dart';
export 'package:bluesky/src/services/entities/embed_view_record_view_record.dart';
export 'package:bluesky/src/services/extensions/grouped_notification.dart';
export 'package:bluesky/src/services/extensions/at_uri.dart';
export 'package:bluesky/src/services/extensions/blob.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:atproto/core.dart';

// 🌎 Project imports:
import '../../../../bluesky.dart';
import '../../../services/entities/embed_view_record_view_record.dart';
import '../../decision.dart';
import '../behaviors/moderation_opts.dart';
import '../labels.dart';
Expand Down
4 changes: 4 additions & 0 deletions packages/bluesky/lib/src/services/actor_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ final class ActorService {
core.Blob? avatar,
core.Blob? banner,
atp.Labels? labels,
atp.StrongRef? joinedViaStarterPack,
atp.StrongRef? pinnedPost,
DateTime? createdAt,
}) async =>
await _ctx.atproto.repo.putRecord(
uri: core.AtUri.make(
Expand All @@ -123,7 +125,9 @@ final class ActorService {
'avatar': avatar,
'banner': banner,
'labels': labels?.toJson(),
'joinedViaStarterPack': joinedViaStarterPack?.toJson(),
'pinnedPost': pinnedPost?.toJson(),
'createdAt': _ctx.toUtcIso8601String(createdAt),
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
// 🌎 Project imports:
import '../../../ids.g.dart' as ids;
import '../../types/app/bsky/embed/record/embed_record_view_detached.dart';
import '../../types/app/bsky/graph/defs/starter_pack_view_basic.dart';
import '../embed_view_record_view.dart';
import '../embed_view_record_view_blocked.dart';
import '../embed_view_record_view_not_found.dart';
Expand Down Expand Up @@ -57,6 +58,10 @@ final class _EmbedViewRecordViewConverter
return EmbedViewRecordView.labelerView(
data: LabelerView.fromJson(json),
);
} else if (type == ids.appBskyGraphDefsStarterPackViewBasic) {
return EmbedViewRecordView.starterPackViewBasic(
data: StarterPackViewBasic.fromJson(json),
);
}

return EmbedViewRecordView.unknown(data: json);
Expand All @@ -74,6 +79,7 @@ final class _EmbedViewRecordViewConverter
generatorView: (data) => data.toJson(),
listView: (data) => data.toJson(),
labelerView: (data) => data.toJson(),
starterPackViewBasic: (data) => data.toJson(),
unknown: (data) => data,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';

// 🌎 Project imports:
import '../types/app/bsky/embed/record/embed_record_view_detached.dart';
import '../types/app/bsky/graph/defs/starter_pack_view_basic.dart';
import 'embed_view_record_view_blocked.dart';
import 'embed_view_record_view_not_found.dart';
import 'embed_view_record_view_record.dart';
Expand Down Expand Up @@ -49,6 +50,10 @@ class EmbedViewRecordView with _$EmbedViewRecordView {
required LabelerView data,
}) = UEmbedViewRecordViewLabelerView;

const factory EmbedViewRecordView.starterPackViewBasic({
required StarterPackViewBasic data,
}) = UEmbedViewRecordViewStarterPackViewBasic;

const factory EmbedViewRecordView.unknown({
required Map<String, dynamic> data,
}) = UEmbedViewRecordViewUnknown;
Expand Down
Loading
Loading