Skip to content

Commit

Permalink
Merge pull request #38 from xmtp/np/update-buf-builder
Browse files Browse the repository at this point in the history
Update buf generation for kotlin and swift
  • Loading branch information
nplasterer authored Mar 26, 2024
2 parents 70cac73 + 9b32e85 commit cf784c5
Show file tree
Hide file tree
Showing 54 changed files with 9,341 additions and 564 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
# vendor/
/dist
node_modules

kotlin/org/xmtp/android/library/push/xmtp
swift/keystore_api
swift/message_api
swift/message_contents
swift/mls
swift/mls_validation
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ If you have made a change to the files in the `proto` folder, you will need to r

You must have the `Buf` CLI installed on your machine. Learn more [here](https://buf.build/docs/installation).

```sh
brew install bufbuild/buf/buf
```

To just rebuild the notification protos run:

```sh
buf generate
```

### Testing the API

The API supports plain JSON and can be used via CURL
Expand Down
16 changes: 16 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: v1
managed:
enabled: true
java_package_prefix:
default: org.xmtp.android.library.push
go_package_prefix:
# <module_name> : name in go.mod
# <relative_path> : where generated code should be output
Expand All @@ -18,3 +20,17 @@ plugins:
out: pkg/proto
opt:
- paths=source_relative
- plugin: buf.build/connectrpc/swift
opt:
- GenerateAsyncMethods=true
- GenerateCallbackMethods=true
- Visibility=Public
out: swift
- plugin: buf.build/apple/swift
opt:
- Visibility=Public
out: swift
- plugin: buf.build/protocolbuffers/java
out: kotlin
- plugin: buf.build/connectrpc/kotlin
out: kotlin
62 changes: 62 additions & 0 deletions integration/gen/notifications/v1/service_connect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// @generated by protoc-gen-connect-es v1.4.0
// @generated from file notifications/v1/service.proto (package notifications.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { DeleteInstallationRequest, RegisterInstallationRequest, RegisterInstallationResponse, SubscribeRequest, SubscribeWithMetadataRequest, UnsubscribeRequest } from "./service_pb.js";
import { Empty, MethodKind } from "@bufbuild/protobuf";

/**
* @generated from service notifications.v1.Notifications
*/
export declare const Notifications: {
readonly typeName: "notifications.v1.Notifications",
readonly methods: {
/**
* @generated from rpc notifications.v1.Notifications.RegisterInstallation
*/
readonly registerInstallation: {
readonly name: "RegisterInstallation",
readonly I: typeof RegisterInstallationRequest,
readonly O: typeof RegisterInstallationResponse,
readonly kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.DeleteInstallation
*/
readonly deleteInstallation: {
readonly name: "DeleteInstallation",
readonly I: typeof DeleteInstallationRequest,
readonly O: typeof Empty,
readonly kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.Subscribe
*/
readonly subscribe: {
readonly name: "Subscribe",
readonly I: typeof SubscribeRequest,
readonly O: typeof Empty,
readonly kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.SubscribeWithMetadata
*/
readonly subscribeWithMetadata: {
readonly name: "SubscribeWithMetadata",
readonly I: typeof SubscribeWithMetadataRequest,
readonly O: typeof Empty,
readonly kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.Unsubscribe
*/
readonly unsubscribe: {
readonly name: "Unsubscribe",
readonly I: typeof UnsubscribeRequest,
readonly O: typeof Empty,
readonly kind: MethodKind.Unary,
},
}
};

62 changes: 62 additions & 0 deletions integration/gen/notifications/v1/service_connect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// @generated by protoc-gen-connect-es v1.4.0
// @generated from file notifications/v1/service.proto (package notifications.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { DeleteInstallationRequest, RegisterInstallationRequest, RegisterInstallationResponse, SubscribeRequest, SubscribeWithMetadataRequest, UnsubscribeRequest } from "./service_pb.js";
import { Empty, MethodKind } from "@bufbuild/protobuf";

/**
* @generated from service notifications.v1.Notifications
*/
export const Notifications = {
typeName: "notifications.v1.Notifications",
methods: {
/**
* @generated from rpc notifications.v1.Notifications.RegisterInstallation
*/
registerInstallation: {
name: "RegisterInstallation",
I: RegisterInstallationRequest,
O: RegisterInstallationResponse,
kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.DeleteInstallation
*/
deleteInstallation: {
name: "DeleteInstallation",
I: DeleteInstallationRequest,
O: Empty,
kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.Subscribe
*/
subscribe: {
name: "Subscribe",
I: SubscribeRequest,
O: Empty,
kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.SubscribeWithMetadata
*/
subscribeWithMetadata: {
name: "SubscribeWithMetadata",
I: SubscribeWithMetadataRequest,
O: Empty,
kind: MethodKind.Unary,
},
/**
* @generated from rpc notifications.v1.Notifications.Unsubscribe
*/
unsubscribe: {
name: "Unsubscribe",
I: UnsubscribeRequest,
O: Empty,
kind: MethodKind.Unary,
},
}
};

Loading

0 comments on commit cf784c5

Please sign in to comment.