Skip to content

Commit

Permalink
proto def and gen for GetSubscriptionEntitlement
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbsky committed Dec 1, 2024
1 parent 69c73a5 commit 2c7f084
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 72 deletions.
19 changes: 14 additions & 5 deletions packages/bsky/proto/bsky.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,19 @@ message GetFollowsFollowingResponse {
message PingRequest {}
message PingResponse {}

// Subscription entitlement
message SubscriptionEntitlement {
string did = 1;
repeated string entitlements = 2;
}

message GetSubscriptionEntitlementRequest {
repeated string dids = 1;
}

message GetSubscriptionEntitlementResponse {
repeated SubscriptionEntitlement subscriptionEntitlements = 1;
}


service Service {
Expand Down Expand Up @@ -1238,6 +1250,8 @@ service Service {
// Ping
rpc Ping(PingRequest) returns (PingResponse);

// Subscription entitlement
rpc GetSubscriptionEntitlement(GetSubscriptionEntitlementRequest) returns (GetSubscriptionEntitlementResponse);



Expand Down Expand Up @@ -1398,11 +1412,6 @@ message ClearThreadMutesRequest {
message ClearThreadMutesResponse {}

// Subscription entitlement
message SubscriptionEntitlement {
string did = 1;
repeated string entitlements = 2;
}

message SetSubscriptionEntitlementRequest {
SubscriptionEntitlement subscriptionEntitlement = 1;
}
Expand Down
13 changes: 13 additions & 0 deletions packages/bsky/src/proto/bsky_connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ import {
GetStarterPackCountsResponse,
GetStarterPackRecordsRequest,
GetStarterPackRecordsResponse,
GetSubscriptionEntitlementRequest,
GetSubscriptionEntitlementResponse,
GetSuggestedEntitiesRequest,
GetSuggestedEntitiesResponse,
GetSuggestedFeedsRequest,
Expand Down Expand Up @@ -976,6 +978,17 @@ export const Service = {
O: PingResponse,
kind: MethodKind.Unary,
},
/**
* Subscription entitlement
*
* @generated from rpc bsky.Service.GetSubscriptionEntitlement
*/
getSubscriptionEntitlement: {
name: 'GetSubscriptionEntitlement',
I: GetSubscriptionEntitlementRequest,
O: GetSubscriptionEntitlementResponse,
kind: MethodKind.Unary,
},
/**
* Moderation
*
Expand Down
264 changes: 197 additions & 67 deletions packages/bsky/src/proto/bsky_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11332,6 +11332,203 @@ export class PingResponse extends Message<PingResponse> {
}
}

/**
* Subscription entitlement
*
* @generated from message bsky.SubscriptionEntitlement
*/
export class SubscriptionEntitlement extends Message<SubscriptionEntitlement> {
/**
* @generated from field: string did = 1;
*/
did = ''

/**
* @generated from field: repeated string entitlements = 2;
*/
entitlements: string[] = []

constructor(data?: PartialMessage<SubscriptionEntitlement>) {
super()
proto3.util.initPartial(data, this)
}

static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'bsky.SubscriptionEntitlement'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'did', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{
no: 2,
name: 'entitlements',
kind: 'scalar',
T: 9 /* ScalarType.STRING */,
repeated: true,
},
])

static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromBinary(bytes, options)
}

static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromJson(jsonValue, options)
}

static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromJsonString(jsonString, options)
}

static equals(
a:
| SubscriptionEntitlement
| PlainMessage<SubscriptionEntitlement>
| undefined,
b:
| SubscriptionEntitlement
| PlainMessage<SubscriptionEntitlement>
| undefined,
): boolean {
return proto3.util.equals(SubscriptionEntitlement, a, b)
}
}

/**
* @generated from message bsky.GetSubscriptionEntitlementRequest
*/
export class GetSubscriptionEntitlementRequest extends Message<GetSubscriptionEntitlementRequest> {
/**
* @generated from field: repeated string dids = 1;
*/
dids: string[] = []

constructor(data?: PartialMessage<GetSubscriptionEntitlementRequest>) {
super()
proto3.util.initPartial(data, this)
}

static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'bsky.GetSubscriptionEntitlementRequest'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{
no: 1,
name: 'dids',
kind: 'scalar',
T: 9 /* ScalarType.STRING */,
repeated: true,
},
])

static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>,
): GetSubscriptionEntitlementRequest {
return new GetSubscriptionEntitlementRequest().fromBinary(bytes, options)
}

static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>,
): GetSubscriptionEntitlementRequest {
return new GetSubscriptionEntitlementRequest().fromJson(jsonValue, options)
}

static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>,
): GetSubscriptionEntitlementRequest {
return new GetSubscriptionEntitlementRequest().fromJsonString(
jsonString,
options,
)
}

static equals(
a:
| GetSubscriptionEntitlementRequest
| PlainMessage<GetSubscriptionEntitlementRequest>
| undefined,
b:
| GetSubscriptionEntitlementRequest
| PlainMessage<GetSubscriptionEntitlementRequest>
| undefined,
): boolean {
return proto3.util.equals(GetSubscriptionEntitlementRequest, a, b)
}
}

/**
* @generated from message bsky.GetSubscriptionEntitlementResponse
*/
export class GetSubscriptionEntitlementResponse extends Message<GetSubscriptionEntitlementResponse> {
/**
* @generated from field: repeated bsky.SubscriptionEntitlement subscriptionEntitlements = 1;
*/
subscriptionEntitlements: SubscriptionEntitlement[] = []

constructor(data?: PartialMessage<GetSubscriptionEntitlementResponse>) {
super()
proto3.util.initPartial(data, this)
}

static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'bsky.GetSubscriptionEntitlementResponse'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{
no: 1,
name: 'subscriptionEntitlements',
kind: 'message',
T: SubscriptionEntitlement,
repeated: true,
},
])

static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>,
): GetSubscriptionEntitlementResponse {
return new GetSubscriptionEntitlementResponse().fromBinary(bytes, options)
}

static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>,
): GetSubscriptionEntitlementResponse {
return new GetSubscriptionEntitlementResponse().fromJson(jsonValue, options)
}

static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>,
): GetSubscriptionEntitlementResponse {
return new GetSubscriptionEntitlementResponse().fromJsonString(
jsonString,
options,
)
}

static equals(
a:
| GetSubscriptionEntitlementResponse
| PlainMessage<GetSubscriptionEntitlementResponse>
| undefined,
b:
| GetSubscriptionEntitlementResponse
| PlainMessage<GetSubscriptionEntitlementResponse>
| undefined,
): boolean {
return proto3.util.equals(GetSubscriptionEntitlementResponse, a, b)
}
}

/**
* @generated from message bsky.UpdateActorUpstreamStatusRequest
*/
Expand Down Expand Up @@ -13156,73 +13353,6 @@ export class ClearThreadMutesResponse extends Message<ClearThreadMutesResponse>
/**
* Subscription entitlement
*
* @generated from message bsky.SubscriptionEntitlement
*/
export class SubscriptionEntitlement extends Message<SubscriptionEntitlement> {
/**
* @generated from field: string did = 1;
*/
did = ''

/**
* @generated from field: repeated string entitlements = 2;
*/
entitlements: string[] = []

constructor(data?: PartialMessage<SubscriptionEntitlement>) {
super()
proto3.util.initPartial(data, this)
}

static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'bsky.SubscriptionEntitlement'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'did', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{
no: 2,
name: 'entitlements',
kind: 'scalar',
T: 9 /* ScalarType.STRING */,
repeated: true,
},
])

static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromBinary(bytes, options)
}

static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromJson(jsonValue, options)
}

static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>,
): SubscriptionEntitlement {
return new SubscriptionEntitlement().fromJsonString(jsonString, options)
}

static equals(
a:
| SubscriptionEntitlement
| PlainMessage<SubscriptionEntitlement>
| undefined,
b:
| SubscriptionEntitlement
| PlainMessage<SubscriptionEntitlement>
| undefined,
): boolean {
return proto3.util.equals(SubscriptionEntitlement, a, b)
}
}

/**
* @generated from message bsky.SetSubscriptionEntitlementRequest
*/
export class SetSubscriptionEntitlementRequest extends Message<SetSubscriptionEntitlementRequest> {
Expand Down

0 comments on commit 2c7f084

Please sign in to comment.