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

Appview v1 maintaining device tokens and pushing notifications w/ courier #2073

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add courier proto to bsky, build
  • Loading branch information
devinivy committed Jan 23, 2024
commit 81bbaa4b5afba6eaab72dc77438efeadd16b6871
2 changes: 1 addition & 1 deletion packages/bsky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test:log": "tail -50 test.log | pino-pretty",
"test:updateSnapshot": "jest --updateSnapshot",
"migration:create": "ts-node ./bin/migration-create.ts",
"buf:gen": "buf generate ../bsync/proto"
"buf:gen": "buf generate ../bsync/proto && buf generate ./proto"
},
"dependencies": {
"@atproto/api": "workspace:^",
Expand Down
56 changes: 56 additions & 0 deletions packages/bsky/proto/courier.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
syntax = "proto3";

package courier;
option go_package = "./;courier";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

//
// Messages
//

// Ping
message PingRequest {}
message PingResponse {}

// Notifications

enum AppPlatform {
APP_PLATFORM_UNSPECIFIED = 0;
APP_PLATFORM_IOS = 1;
APP_PLATFORM_ANDROID = 2;
APP_PLATFORM_WEB = 3;
}

message Notification {
string id = 1;
string recipient_did = 2;
string title = 3;
string message = 4;
string collapse_key = 5;
bool always_deliver = 6;
google.protobuf.Timestamp timestamp = 7;
google.protobuf.Struct additional = 8;
}

message PushNotificationsRequest {
repeated Notification notifications = 1;
}

message PushNotificationsResponse {}

message RegisterDeviceTokenRequest {
string did = 1;
string token = 2;
string app_id = 3;
AppPlatform platform = 4;
}

message RegisterDeviceTokenResponse {}

service Service {
rpc Ping(PingRequest) returns (PingResponse);
rpc PushNotifications(PushNotificationsRequest) returns (PushNotificationsResponse);
rpc RegisterDeviceToken(RegisterDeviceTokenRequest) returns (RegisterDeviceTokenResponse);
}
50 changes: 50 additions & 0 deletions packages/bsky/src/proto/courier_connect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts,import_extension=.ts"
// @generated from file courier.proto (package courier, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import {
PingRequest,
PingResponse,
PushNotificationsRequest,
PushNotificationsResponse,
RegisterDeviceTokenRequest,
RegisterDeviceTokenResponse,
} from './courier_pb.ts'
import { MethodKind } from '@bufbuild/protobuf'

/**
* @generated from service courier.Service
*/
export const Service = {
typeName: 'courier.Service',
methods: {
/**
* @generated from rpc courier.Service.Ping
*/
ping: {
name: 'Ping',
I: PingRequest,
O: PingResponse,
kind: MethodKind.Unary,
},
/**
* @generated from rpc courier.Service.PushNotifications
*/
pushNotifications: {
name: 'PushNotifications',
I: PushNotificationsRequest,
O: PushNotificationsResponse,
kind: MethodKind.Unary,
},
/**
* @generated from rpc courier.Service.RegisterDeviceToken
*/
registerDeviceToken: {
name: 'RegisterDeviceToken',
I: RegisterDeviceTokenRequest,
O: RegisterDeviceTokenResponse,
kind: MethodKind.Unary,
},
},
} as const
Loading