From eb4cfb9db562d26d507613e0153158a3f0576b20 Mon Sep 17 00:00:00 2001 From: dholms Date: Tue, 30 Jan 2024 20:14:11 -0600 Subject: [PATCH] format --- packages/pds/buf.gen.yaml | 2 +- packages/pds/src/proto/courier_connect.ts | 24 +- packages/pds/src/proto/courier_pb.ts | 438 ++++++++++++++-------- 3 files changed, 303 insertions(+), 161 deletions(-) diff --git a/packages/pds/buf.gen.yaml b/packages/pds/buf.gen.yaml index 29f9668b5b8..a81e4248719 100644 --- a/packages/pds/buf.gen.yaml +++ b/packages/pds/buf.gen.yaml @@ -9,4 +9,4 @@ plugins: opt: - target=ts - import_extension=.ts - out: src/proto \ No newline at end of file + out: src/proto diff --git a/packages/pds/src/proto/courier_connect.ts b/packages/pds/src/proto/courier_connect.ts index cdf50cca128..04d482e0788 100644 --- a/packages/pds/src/proto/courier_connect.ts +++ b/packages/pds/src/proto/courier_connect.ts @@ -3,20 +3,27 @@ /* eslint-disable */ // @ts-nocheck -import { PingRequest, PingResponse, PushNotificationsRequest, PushNotificationsResponse, RegisterDeviceTokenRequest, RegisterDeviceTokenResponse } from "./courier_pb.ts"; -import { MethodKind } from "@bufbuild/protobuf"; +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", + typeName: 'courier.Service', methods: { /** * @generated from rpc courier.Service.Ping */ ping: { - name: "Ping", + name: 'Ping', I: PingRequest, O: PingResponse, kind: MethodKind.Unary, @@ -25,7 +32,7 @@ export const Service = { * @generated from rpc courier.Service.PushNotifications */ pushNotifications: { - name: "PushNotifications", + name: 'PushNotifications', I: PushNotificationsRequest, O: PushNotificationsResponse, kind: MethodKind.Unary, @@ -34,11 +41,10 @@ export const Service = { * @generated from rpc courier.Service.RegisterDeviceToken */ registerDeviceToken: { - name: "RegisterDeviceToken", + name: 'RegisterDeviceToken', I: RegisterDeviceTokenRequest, O: RegisterDeviceTokenResponse, kind: MethodKind.Unary, }, - } -} as const; - + }, +} as const diff --git a/packages/pds/src/proto/courier_pb.ts b/packages/pds/src/proto/courier_pb.ts index 3d413c0a3ff..2e88dd630bc 100644 --- a/packages/pds/src/proto/courier_pb.ts +++ b/packages/pds/src/proto/courier_pb.ts @@ -3,8 +3,15 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, Struct, Timestamp } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf' +import { Message, proto3, Struct, Timestamp } from '@bufbuild/protobuf' /** * @generated from enum courier.AppPlatform @@ -31,12 +38,12 @@ export enum AppPlatform { WEB = 3, } // Retrieve enum metadata with: proto3.getEnumType(AppPlatform) -proto3.util.setEnumType(AppPlatform, "courier.AppPlatform", [ - { no: 0, name: "APP_PLATFORM_UNSPECIFIED" }, - { no: 1, name: "APP_PLATFORM_IOS" }, - { no: 2, name: "APP_PLATFORM_ANDROID" }, - { no: 3, name: "APP_PLATFORM_WEB" }, -]); +proto3.util.setEnumType(AppPlatform, 'courier.AppPlatform', [ + { no: 0, name: 'APP_PLATFORM_UNSPECIFIED' }, + { no: 1, name: 'APP_PLATFORM_IOS' }, + { no: 2, name: 'APP_PLATFORM_ANDROID' }, + { no: 3, name: 'APP_PLATFORM_WEB' }, +]) /** * Ping @@ -45,29 +52,40 @@ proto3.util.setEnumType(AppPlatform, "courier.AppPlatform", [ */ export class PingRequest extends Message { constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.PingRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.PingRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) - static fromBinary(bytes: Uint8Array, options?: Partial): PingRequest { - return new PingRequest().fromBinary(bytes, options); + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PingRequest { + return new PingRequest().fromBinary(bytes, options) } - static fromJson(jsonValue: JsonValue, options?: Partial): PingRequest { - return new PingRequest().fromJson(jsonValue, options); + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): PingRequest { + return new PingRequest().fromJson(jsonValue, options) } - static fromJsonString(jsonString: string, options?: Partial): PingRequest { - return new PingRequest().fromJsonString(jsonString, options); + static fromJsonString( + jsonString: string, + options?: Partial, + ): PingRequest { + return new PingRequest().fromJsonString(jsonString, options) } - static equals(a: PingRequest | PlainMessage | undefined, b: PingRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PingRequest, a, b); + static equals( + a: PingRequest | PlainMessage | undefined, + b: PingRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PingRequest, a, b) } } @@ -76,29 +94,40 @@ export class PingRequest extends Message { */ export class PingResponse extends Message { constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.PingResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.PingResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) - static fromBinary(bytes: Uint8Array, options?: Partial): PingResponse { - return new PingResponse().fromBinary(bytes, options); + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PingResponse { + return new PingResponse().fromBinary(bytes, options) } - static fromJson(jsonValue: JsonValue, options?: Partial): PingResponse { - return new PingResponse().fromJson(jsonValue, options); + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): PingResponse { + return new PingResponse().fromJson(jsonValue, options) } - static fromJsonString(jsonString: string, options?: Partial): PingResponse { - return new PingResponse().fromJsonString(jsonString, options); + static fromJsonString( + jsonString: string, + options?: Partial, + ): PingResponse { + return new PingResponse().fromJsonString(jsonString, options) } - static equals(a: PingResponse | PlainMessage | undefined, b: PingResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PingResponse, a, b); + static equals( + a: PingResponse | PlainMessage | undefined, + b: PingResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PingResponse, a, b) } } @@ -109,75 +138,102 @@ export class Notification extends Message { /** * @generated from field: string id = 1; */ - id = ""; + id = '' /** * @generated from field: string recipient_did = 2; */ - recipientDid = ""; + recipientDid = '' /** * @generated from field: string title = 3; */ - title = ""; + title = '' /** * @generated from field: string message = 4; */ - message = ""; + message = '' /** * @generated from field: string collapse_key = 5; */ - collapseKey = ""; + collapseKey = '' /** * @generated from field: bool always_deliver = 6; */ - alwaysDeliver = false; + alwaysDeliver = false /** * @generated from field: google.protobuf.Timestamp timestamp = 7; */ - timestamp?: Timestamp; + timestamp?: Timestamp /** * @generated from field: google.protobuf.Struct additional = 8; */ - additional?: Struct; + additional?: Struct constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.Notification"; + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.Notification' static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "recipient_did", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "collapse_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "always_deliver", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 7, name: "timestamp", kind: "message", T: Timestamp }, - { no: 8, name: "additional", kind: "message", T: Struct }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Notification { - return new Notification().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Notification { - return new Notification().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Notification { - return new Notification().fromJsonString(jsonString, options); - } - - static equals(a: Notification | PlainMessage | undefined, b: Notification | PlainMessage | undefined): boolean { - return proto3.util.equals(Notification, a, b); + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'recipient_did', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'title', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'message', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 5, + name: 'collapse_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 6, + name: 'always_deliver', + kind: 'scalar', + T: 8 /* ScalarType.BOOL */, + }, + { no: 7, name: 'timestamp', kind: 'message', T: Timestamp }, + { no: 8, name: 'additional', kind: 'message', T: Struct }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): Notification { + return new Notification().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): Notification { + return new Notification().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): Notification { + return new Notification().fromJsonString(jsonString, options) + } + + static equals( + a: Notification | PlainMessage | undefined, + b: Notification | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Notification, a, b) } } @@ -188,33 +244,57 @@ export class PushNotificationsRequest extends Message /** * @generated from field: repeated courier.Notification notifications = 1; */ - notifications: Notification[] = []; + notifications: Notification[] = [] constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.PushNotificationsRequest"; + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.PushNotificationsRequest' static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "notifications", kind: "message", T: Notification, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PushNotificationsRequest { - return new PushNotificationsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PushNotificationsRequest { - return new PushNotificationsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PushNotificationsRequest { - return new PushNotificationsRequest().fromJsonString(jsonString, options); - } - - static equals(a: PushNotificationsRequest | PlainMessage | undefined, b: PushNotificationsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PushNotificationsRequest, a, b); + { + no: 1, + name: 'notifications', + kind: 'message', + T: Notification, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PushNotificationsRequest { + return new PushNotificationsRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): PushNotificationsRequest { + return new PushNotificationsRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): PushNotificationsRequest { + return new PushNotificationsRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | PushNotificationsRequest + | PlainMessage + | undefined, + b: + | PushNotificationsRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(PushNotificationsRequest, a, b) } } @@ -223,29 +303,46 @@ export class PushNotificationsRequest extends Message */ export class PushNotificationsResponse extends Message { constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.PushNotificationsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.PushNotificationsResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) - static fromBinary(bytes: Uint8Array, options?: Partial): PushNotificationsResponse { - return new PushNotificationsResponse().fromBinary(bytes, options); + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PushNotificationsResponse { + return new PushNotificationsResponse().fromBinary(bytes, options) } - static fromJson(jsonValue: JsonValue, options?: Partial): PushNotificationsResponse { - return new PushNotificationsResponse().fromJson(jsonValue, options); + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): PushNotificationsResponse { + return new PushNotificationsResponse().fromJson(jsonValue, options) } - static fromJsonString(jsonString: string, options?: Partial): PushNotificationsResponse { - return new PushNotificationsResponse().fromJsonString(jsonString, options); + static fromJsonString( + jsonString: string, + options?: Partial, + ): PushNotificationsResponse { + return new PushNotificationsResponse().fromJsonString(jsonString, options) } - static equals(a: PushNotificationsResponse | PlainMessage | undefined, b: PushNotificationsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PushNotificationsResponse, a, b); + static equals( + a: + | PushNotificationsResponse + | PlainMessage + | undefined, + b: + | PushNotificationsResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(PushNotificationsResponse, a, b) } } @@ -256,51 +353,74 @@ export class RegisterDeviceTokenRequest extends Message) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.RegisterDeviceTokenRequest"; + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.RegisterDeviceTokenRequest' static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "did", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "app_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "platform", kind: "enum", T: proto3.getEnumType(AppPlatform) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterDeviceTokenRequest { - return new RegisterDeviceTokenRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterDeviceTokenRequest { - return new RegisterDeviceTokenRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RegisterDeviceTokenRequest { - return new RegisterDeviceTokenRequest().fromJsonString(jsonString, options); - } - - static equals(a: RegisterDeviceTokenRequest | PlainMessage | undefined, b: RegisterDeviceTokenRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterDeviceTokenRequest, a, b); + { no: 1, name: 'did', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'token', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'app_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: 'platform', + kind: 'enum', + T: proto3.getEnumType(AppPlatform), + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): RegisterDeviceTokenRequest { + return new RegisterDeviceTokenRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): RegisterDeviceTokenRequest { + return new RegisterDeviceTokenRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): RegisterDeviceTokenRequest { + return new RegisterDeviceTokenRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | RegisterDeviceTokenRequest + | PlainMessage + | undefined, + b: + | RegisterDeviceTokenRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(RegisterDeviceTokenRequest, a, b) } } @@ -309,29 +429,45 @@ export class RegisterDeviceTokenRequest extends Message { constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); + super() + proto3.util.initPartial(data, this) } - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "courier.RegisterDeviceTokenResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'courier.RegisterDeviceTokenResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterDeviceTokenResponse { - return new RegisterDeviceTokenResponse().fromBinary(bytes, options); + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): RegisterDeviceTokenResponse { + return new RegisterDeviceTokenResponse().fromBinary(bytes, options) } - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterDeviceTokenResponse { - return new RegisterDeviceTokenResponse().fromJson(jsonValue, options); + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): RegisterDeviceTokenResponse { + return new RegisterDeviceTokenResponse().fromJson(jsonValue, options) } - static fromJsonString(jsonString: string, options?: Partial): RegisterDeviceTokenResponse { - return new RegisterDeviceTokenResponse().fromJsonString(jsonString, options); + static fromJsonString( + jsonString: string, + options?: Partial, + ): RegisterDeviceTokenResponse { + return new RegisterDeviceTokenResponse().fromJsonString(jsonString, options) } - static equals(a: RegisterDeviceTokenResponse | PlainMessage | undefined, b: RegisterDeviceTokenResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterDeviceTokenResponse, a, b); + static equals( + a: + | RegisterDeviceTokenResponse + | PlainMessage + | undefined, + b: + | RegisterDeviceTokenResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(RegisterDeviceTokenResponse, a, b) } } -