@devvit/protos 0.11.0-next-2024-08-06-9a9058384.0 → 0.11.0-next-2024-08-06-2b2a01b37.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
5
5
  import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
6
6
  import { Echo } from "./echo";
7
7
  import { stackIntercept } from "@protobuf-ts/runtime-rpc";
8
- import type { Str } from "../runtime_common";
8
+ import type { StringValue } from "../../../google/protobuf/wrappers";
9
9
  import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
10
10
  import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
11
11
  /**
@@ -13,9 +13,9 @@ import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
13
13
  */
14
14
  export interface IEchoClient {
15
15
  /**
16
- * @generated from protobuf rpc: Echo(devvit.runtime.Str) returns (devvit.runtime.Str);
16
+ * @generated from protobuf rpc: Echo(google.protobuf.StringValue) returns (google.protobuf.StringValue);
17
17
  */
18
- echo(input: Str, options?: RpcOptions): UnaryCall<Str, Str>;
18
+ echo(input: StringValue, options?: RpcOptions): UnaryCall<StringValue, StringValue>;
19
19
  }
20
20
  /**
21
21
  * @generated from protobuf service devvit.runtime.actor.Echo
@@ -27,10 +27,10 @@ export class EchoClient implements IEchoClient, ServiceInfo {
27
27
  constructor(private readonly _transport: RpcTransport) {
28
28
  }
29
29
  /**
30
- * @generated from protobuf rpc: Echo(devvit.runtime.Str) returns (devvit.runtime.Str);
30
+ * @generated from protobuf rpc: Echo(google.protobuf.StringValue) returns (google.protobuf.StringValue);
31
31
  */
32
- echo(input: Str, options?: RpcOptions): UnaryCall<Str, Str> {
32
+ echo(input: StringValue, options?: RpcOptions): UnaryCall<StringValue, StringValue> {
33
33
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
34
- return stackIntercept<Str, Str>("unary", this._transport, method, opt, input);
34
+ return stackIntercept<StringValue, StringValue>("unary", this._transport, method, opt, input);
35
35
  }
36
36
  }
@@ -1,11 +1,11 @@
1
1
  // @generated by protobuf-ts 2.9.3
2
2
  // @generated from protobuf file "devvit/runtime/actor/echo.proto" (package "devvit.runtime.actor", syntax proto3)
3
3
  // tslint:disable
4
- import { Str } from "../runtime_common";
4
+ import { StringValue } from "../../../google/protobuf/wrappers";
5
5
  import { ServiceType } from "@protobuf-ts/runtime-rpc";
6
6
  /**
7
7
  * @generated ServiceType for protobuf service devvit.runtime.actor.Echo
8
8
  */
9
9
  export const Echo = new ServiceType("devvit.runtime.actor.Echo", [
10
- { name: "Echo", options: {}, I: Str, O: Str }
10
+ { name: "Echo", options: {}, I: StringValue, O: StringValue }
11
11
  ]);
@@ -10,29 +10,6 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
10
10
  import type { PartialMessage } from "@protobuf-ts/runtime";
11
11
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
12
  import { MessageType } from "@protobuf-ts/runtime";
13
- import { Value } from "../../google/protobuf/struct";
14
- /**
15
- * @generated from protobuf message devvit.runtime.Ack
16
- */
17
- export interface Ack {
18
- /**
19
- * @generated from protobuf field: bool success = 1;
20
- */
21
- success: boolean;
22
- /**
23
- * @generated from protobuf field: repeated string messages = 2;
24
- */
25
- messages: string[];
26
- }
27
- /**
28
- * @generated from protobuf message devvit.runtime.Debug
29
- */
30
- export interface Debug {
31
- /**
32
- * @generated from protobuf field: google.protobuf.Value message = 1;
33
- */
34
- message?: Value;
35
- }
36
13
  /**
37
14
  * @generated from protobuf message devvit.runtime.Strings
38
15
  */
@@ -42,119 +19,6 @@ export interface Strings {
42
19
  */
43
20
  values: string[];
44
21
  }
45
- /**
46
- * to-do: replace with StringValue. See
47
- * https://github.com/stephenh/ts-proto/issues/69.
48
- *
49
- * @generated from protobuf message devvit.runtime.Str
50
- */
51
- export interface Str {
52
- /**
53
- * @generated from protobuf field: string value = 1;
54
- */
55
- value: string;
56
- }
57
- // @generated message type with reflection information, may provide speed optimized methods
58
- class Ack$Type extends MessageType<Ack> {
59
- constructor() {
60
- super("devvit.runtime.Ack", [
61
- { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
62
- { no: 2, name: "messages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
63
- ]);
64
- }
65
- create(value?: PartialMessage<Ack>): Ack {
66
- const message = globalThis.Object.create((this.messagePrototype!));
67
- message.success = false;
68
- message.messages = [];
69
- if (value !== undefined)
70
- reflectionMergePartial<Ack>(this, message, value);
71
- return message;
72
- }
73
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Ack): Ack {
74
- let message = target ?? this.create(), end = reader.pos + length;
75
- while (reader.pos < end) {
76
- let [fieldNo, wireType] = reader.tag();
77
- switch (fieldNo) {
78
- case /* bool success */ 1:
79
- message.success = reader.bool();
80
- break;
81
- case /* repeated string messages */ 2:
82
- message.messages.push(reader.string());
83
- break;
84
- default:
85
- let u = options.readUnknownField;
86
- if (u === "throw")
87
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
88
- let d = reader.skip(wireType);
89
- if (u !== false)
90
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
91
- }
92
- }
93
- return message;
94
- }
95
- internalBinaryWrite(message: Ack, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
96
- /* bool success = 1; */
97
- if (message.success !== false)
98
- writer.tag(1, WireType.Varint).bool(message.success);
99
- /* repeated string messages = 2; */
100
- for (let i = 0; i < message.messages.length; i++)
101
- writer.tag(2, WireType.LengthDelimited).string(message.messages[i]);
102
- let u = options.writeUnknownFields;
103
- if (u !== false)
104
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
105
- return writer;
106
- }
107
- }
108
- /**
109
- * @generated MessageType for protobuf message devvit.runtime.Ack
110
- */
111
- export const Ack = new Ack$Type();
112
- // @generated message type with reflection information, may provide speed optimized methods
113
- class Debug$Type extends MessageType<Debug> {
114
- constructor() {
115
- super("devvit.runtime.Debug", [
116
- { no: 1, name: "message", kind: "message", T: () => Value }
117
- ]);
118
- }
119
- create(value?: PartialMessage<Debug>): Debug {
120
- const message = globalThis.Object.create((this.messagePrototype!));
121
- if (value !== undefined)
122
- reflectionMergePartial<Debug>(this, message, value);
123
- return message;
124
- }
125
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Debug): Debug {
126
- let message = target ?? this.create(), end = reader.pos + length;
127
- while (reader.pos < end) {
128
- let [fieldNo, wireType] = reader.tag();
129
- switch (fieldNo) {
130
- case /* google.protobuf.Value message */ 1:
131
- message.message = Value.internalBinaryRead(reader, reader.uint32(), options, message.message);
132
- break;
133
- default:
134
- let u = options.readUnknownField;
135
- if (u === "throw")
136
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
137
- let d = reader.skip(wireType);
138
- if (u !== false)
139
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
140
- }
141
- }
142
- return message;
143
- }
144
- internalBinaryWrite(message: Debug, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
145
- /* google.protobuf.Value message = 1; */
146
- if (message.message)
147
- Value.internalBinaryWrite(message.message, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
148
- let u = options.writeUnknownFields;
149
- if (u !== false)
150
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
151
- return writer;
152
- }
153
- }
154
- /**
155
- * @generated MessageType for protobuf message devvit.runtime.Debug
156
- */
157
- export const Debug = new Debug$Type();
158
22
  // @generated message type with reflection information, may provide speed optimized methods
159
23
  class Strings$Type extends MessageType<Strings> {
160
24
  constructor() {
@@ -202,50 +66,3 @@ class Strings$Type extends MessageType<Strings> {
202
66
  * @generated MessageType for protobuf message devvit.runtime.Strings
203
67
  */
204
68
  export const Strings = new Strings$Type();
205
- // @generated message type with reflection information, may provide speed optimized methods
206
- class Str$Type extends MessageType<Str> {
207
- constructor() {
208
- super("devvit.runtime.Str", [
209
- { no: 1, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
210
- ]);
211
- }
212
- create(value?: PartialMessage<Str>): Str {
213
- const message = globalThis.Object.create((this.messagePrototype!));
214
- message.value = "";
215
- if (value !== undefined)
216
- reflectionMergePartial<Str>(this, message, value);
217
- return message;
218
- }
219
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Str): Str {
220
- let message = target ?? this.create(), end = reader.pos + length;
221
- while (reader.pos < end) {
222
- let [fieldNo, wireType] = reader.tag();
223
- switch (fieldNo) {
224
- case /* string value */ 1:
225
- message.value = reader.string();
226
- break;
227
- default:
228
- let u = options.readUnknownField;
229
- if (u === "throw")
230
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
231
- let d = reader.skip(wireType);
232
- if (u !== false)
233
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
234
- }
235
- }
236
- return message;
237
- }
238
- internalBinaryWrite(message: Str, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
239
- /* string value = 1; */
240
- if (message.value !== "")
241
- writer.tag(1, WireType.LengthDelimited).string(message.value);
242
- let u = options.writeUnknownFields;
243
- if (u !== false)
244
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
245
- return writer;
246
- }
247
- }
248
- /**
249
- * @generated MessageType for protobuf message devvit.runtime.Str
250
- */
251
- export const Str = new Str$Type();
@@ -2,11 +2,11 @@ syntax = "proto3";
2
2
 
3
3
  package devvit.runtime.actor;
4
4
 
5
- import "devvit/runtime/runtime_common.proto";
5
+ import "google/protobuf/wrappers.proto";
6
6
 
7
7
  option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/runtime/actor";
8
8
  option java_package = "com.reddit.devvit.runtime.actor";
9
9
 
10
10
  service Echo {
11
- rpc Echo(Str) returns (Str);
11
+ rpc Echo(google.protobuf.StringValue) returns (google.protobuf.StringValue);
12
12
  }
@@ -2,26 +2,9 @@ syntax = "proto3";
2
2
 
3
3
  package devvit.runtime;
4
4
 
5
- import "google/protobuf/struct.proto";
6
-
7
5
  option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/runtime";
8
6
  option java_package = "com.reddit.devvit.runtime";
9
7
 
10
- message Ack {
11
- bool success = 1;
12
- repeated string messages = 2;
13
- }
14
-
15
- message Debug {
16
- google.protobuf.Value message = 1;
17
- }
18
-
19
8
  message Strings {
20
9
  repeated string values = 1;
21
10
  }
22
-
23
- // to-do: replace with StringValue. See
24
- // https://github.com/stephenh/ts-proto/issues/69.
25
- message Str {
26
- string value = 1;
27
- }
Binary file
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import _m0 from "protobufjs/minimal.js";
7
7
  import { Metadata } from "../../../../lib/Types.js";
8
- import { Str } from "../runtime_common.js";
8
+ import { StringValue } from "../../../google/protobuf/wrappers.js";
9
9
  export interface Echo {
10
- Echo(request: Str, metadata?: Metadata): Promise<Str>;
10
+ Echo(request: StringValue, metadata?: Metadata): Promise<StringValue>;
11
11
  }
12
12
  export declare const EchoServiceName = "devvit.runtime.actor.Echo";
13
13
  export declare class EchoClientImpl implements Echo {
@@ -16,7 +16,7 @@ export declare class EchoClientImpl implements Echo {
16
16
  constructor(rpc: Rpc, opts?: {
17
17
  service?: string;
18
18
  });
19
- Echo(request: Str, metadata?: Metadata): Promise<Str>;
19
+ Echo(request: StringValue, metadata?: Metadata): Promise<StringValue>;
20
20
  }
21
21
  export type EchoDefinition = typeof EchoDefinition;
22
22
  export declare const EchoDefinition: {
@@ -26,31 +26,31 @@ export declare const EchoDefinition: {
26
26
  readonly echo: {
27
27
  readonly name: "Echo";
28
28
  readonly requestType: {
29
- $type: "devvit.runtime.Str";
30
- encode(message: Str, writer?: _m0.Writer): _m0.Writer;
31
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Str;
32
- fromJSON(object: any): Str;
33
- toJSON(message: Str): unknown;
29
+ $type: "google.protobuf.StringValue";
30
+ encode(message: StringValue, writer?: _m0.Writer): _m0.Writer;
31
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): StringValue;
32
+ fromJSON(object: any): StringValue;
33
+ toJSON(message: StringValue): unknown;
34
34
  create(base?: {
35
35
  value?: string;
36
- } | undefined): Str;
36
+ } | undefined): StringValue;
37
37
  fromPartial(object: {
38
38
  value?: string;
39
- }): Str;
39
+ }): StringValue;
40
40
  };
41
41
  readonly requestStream: false;
42
42
  readonly responseType: {
43
- $type: "devvit.runtime.Str";
44
- encode(message: Str, writer?: _m0.Writer): _m0.Writer;
45
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Str;
46
- fromJSON(object: any): Str;
47
- toJSON(message: Str): unknown;
43
+ $type: "google.protobuf.StringValue";
44
+ encode(message: StringValue, writer?: _m0.Writer): _m0.Writer;
45
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): StringValue;
46
+ fromJSON(object: any): StringValue;
47
+ toJSON(message: StringValue): unknown;
48
48
  create(base?: {
49
49
  value?: string;
50
- } | undefined): Str;
50
+ } | undefined): StringValue;
51
51
  fromPartial(object: {
52
52
  value?: string;
53
- }): Str;
53
+ }): StringValue;
54
54
  };
55
55
  readonly responseStream: false;
56
56
  readonly options: {};
@@ -1 +1 @@
1
- {"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/runtime/actor/echo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAE3C,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG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AS;gBACrB,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAKjD,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;CAKtE;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AACnD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAajB,CAAC;AAEX,UAAU,GAAG;IACX,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtG"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  /* eslint-disable */
7
7
  import _m0 from "protobufjs/minimal.js";
8
- import { Str } from "../runtime_common.js";
8
+ import { StringValue } from "../../../google/protobuf/wrappers.js";
9
9
  export const EchoServiceName = "devvit.runtime.actor.Echo";
10
10
  export class EchoClientImpl {
11
11
  constructor(rpc, opts) {
@@ -14,9 +14,9 @@ export class EchoClientImpl {
14
14
  this.Echo = this.Echo.bind(this);
15
15
  }
16
16
  Echo(request, metadata) {
17
- const data = Str.encode(request).finish();
17
+ const data = StringValue.encode(request).finish();
18
18
  const promise = this.rpc.request(this.service, "Echo", data, metadata);
19
- return promise.then((data) => Str.decode(_m0.Reader.create(data)));
19
+ return promise.then((data) => StringValue.decode(_m0.Reader.create(data)));
20
20
  }
21
21
  }
22
22
  export const EchoDefinition = {
@@ -25,9 +25,9 @@ export const EchoDefinition = {
25
25
  methods: {
26
26
  echo: {
27
27
  name: "Echo",
28
- requestType: Str,
28
+ requestType: StringValue,
29
29
  requestStream: false,
30
- responseType: Str,
30
+ responseType: StringValue,
31
31
  responseStream: false,
32
32
  options: {},
33
33
  },
@@ -1,19 +1,19 @@
1
- import { Str } from '../runtime_common.js';
1
+ import { StringValue } from '../../../google/protobuf/wrappers.js';
2
2
  interface Rpc {
3
3
  request(service: string, method: string, contentType: 'application/json' | 'application/protobuf', data: object | Uint8Array): Promise<object | Uint8Array>;
4
4
  }
5
5
  export interface EchoClient {
6
- Echo(request: Str): Promise<Str>;
6
+ Echo(request: StringValue): Promise<StringValue>;
7
7
  }
8
8
  export declare class EchoClientJSON implements EchoClient {
9
9
  private readonly rpc;
10
10
  constructor(rpc: Rpc);
11
- Echo(request: Str): Promise<Str>;
11
+ Echo(request: StringValue): Promise<StringValue>;
12
12
  }
13
13
  export declare class EchoClientProtobuf implements EchoClient {
14
14
  private readonly rpc;
15
15
  constructor(rpc: Rpc);
16
- Echo(request: Str): Promise<Str>;
16
+ Echo(request: StringValue): Promise<StringValue>;
17
17
  }
18
18
  export {};
19
19
  //# sourceMappingURL=echo.twirp-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"echo.twirp-client.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/runtime/actor/echo.twirp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAM3C,UAAU,GAAG;IACX,OAAO,CACL,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,kBAAkB,GAAG,sBAAsB,EACxD,IAAI,EAAE,MAAM,GAAG,UAAU,GACxB,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAUjC;AAED,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAUjC"}
1
+ {"version":3,"file":"echo.twirp-client.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/runtime/actor/echo.twirp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAMnE,UAAU,GAAG;IACX,OAAO,CACL,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,kBAAkB,GAAG,sBAAsB,EACxD,IAAI,EAAE,MAAM,GAAG,UAAU,GACxB,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAClD;AAED,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAUjD;AAED,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAUjD"}
@@ -1,13 +1,13 @@
1
- import { Str } from '../runtime_common.js';
1
+ import { StringValue } from '../../../google/protobuf/wrappers.js';
2
2
  export class EchoClientJSON {
3
3
  constructor(rpc) {
4
4
  this.rpc = rpc;
5
5
  this.Echo.bind(this);
6
6
  }
7
7
  Echo(request) {
8
- const data = Str.toJSON(request);
8
+ const data = StringValue.toJSON(request);
9
9
  const promise = this.rpc.request('devvit.runtime.actor.Echo', 'Echo', 'application/json', data);
10
- return promise.then((data) => Str.fromJSON(data));
10
+ return promise.then((data) => StringValue.fromJSON(data));
11
11
  }
12
12
  }
13
13
  export class EchoClientProtobuf {
@@ -16,8 +16,8 @@ export class EchoClientProtobuf {
16
16
  this.Echo.bind(this);
17
17
  }
18
18
  Echo(request) {
19
- const data = Str.encode(request).finish();
19
+ const data = StringValue.encode(request).finish();
20
20
  const promise = this.rpc.request('devvit.runtime.actor.Echo', 'Echo', 'application/protobuf', data);
21
- return promise.then((data) => Str.decode(data));
21
+ return promise.then((data) => StringValue.decode(data));
22
22
  }
23
23
  }
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  import { TwirpContext, TwirpServer } from 'twirp-ts';
3
- import { Str } from '../runtime_common.js';
3
+ import { StringValue } from '../../../google/protobuf/wrappers.js';
4
4
  export interface EchoTwirp<T extends TwirpContext = TwirpContext> {
5
- Echo(ctx: T, request: Str): Promise<Str>;
5
+ Echo(ctx: T, request: StringValue): Promise<StringValue>;
6
6
  }
7
7
  export declare enum EchoMethod {
8
8
  Echo = "Echo"
@@ -1 +1 @@
1
- {"version":3,"file":"echo.twirp.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/runtime/actor/echo.twirp.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EAOZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAM3C,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAC9D,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC1C;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,cAAc,cAAoB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACpE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,0IAStB"}
1
+ {"version":3,"file":"echo.twirp.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/runtime/actor/echo.twirp.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EAOZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAMnE,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAC9D,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC1D;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,cAAc,cAAoB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACpE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,0IAStB"}
@@ -1,5 +1,5 @@
1
1
  import { TwirpServer, TwirpError, TwirpErrorCode, TwirpContentType, chainInterceptors, } from 'twirp-ts';
2
- import { Str } from '../runtime_common.js';
2
+ import { StringValue } from '../../../google/protobuf/wrappers.js';
3
3
  export var EchoMethod;
4
4
  (function (EchoMethod) {
5
5
  EchoMethod["Echo"] = "Echo";
@@ -44,7 +44,7 @@ async function handleEchoEchoJSON(ctx, service, data, interceptors) {
44
44
  let response;
45
45
  try {
46
46
  const body = JSON.parse(data.toString() || '{}');
47
- request = Str.fromJSON(body);
47
+ request = StringValue.fromJSON(body);
48
48
  }
49
49
  catch (e) {
50
50
  if (e instanceof Error) {
@@ -61,13 +61,13 @@ async function handleEchoEchoJSON(ctx, service, data, interceptors) {
61
61
  else {
62
62
  response = await service.Echo(ctx, request);
63
63
  }
64
- return JSON.stringify(Str.toJSON(response));
64
+ return JSON.stringify(StringValue.toJSON(response));
65
65
  }
66
66
  async function handleEchoEchoProtobuf(ctx, service, data, interceptors) {
67
67
  let request;
68
68
  let response;
69
69
  try {
70
- request = Str.decode(data);
70
+ request = StringValue.decode(data);
71
71
  }
72
72
  catch (e) {
73
73
  if (e instanceof Error) {
@@ -84,5 +84,5 @@ async function handleEchoEchoProtobuf(ctx, service, data, interceptors) {
84
84
  else {
85
85
  response = await service.Echo(ctx, request);
86
86
  }
87
- return Buffer.from(Str.encode(response).finish());
87
+ return Buffer.from(StringValue.encode(response).finish());
88
88
  }
@@ -4,41 +4,9 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  import _m0 from "protobufjs/minimal.js";
7
- export interface Ack {
8
- success: boolean;
9
- messages: string[];
10
- }
11
- export interface Debug {
12
- message?: any | undefined;
13
- }
14
7
  export interface Strings {
15
8
  values: string[];
16
9
  }
17
- /**
18
- * to-do: replace with StringValue. See
19
- * https://github.com/stephenh/ts-proto/issues/69.
20
- */
21
- export interface Str {
22
- value: string;
23
- }
24
- export declare const Ack: {
25
- $type: "devvit.runtime.Ack";
26
- encode(message: Ack, writer?: _m0.Writer): _m0.Writer;
27
- decode(input: _m0.Reader | Uint8Array, length?: number): Ack;
28
- fromJSON(object: any): Ack;
29
- toJSON(message: Ack): unknown;
30
- create(base?: DeepPartial<Ack>): Ack;
31
- fromPartial(object: DeepPartial<Ack>): Ack;
32
- };
33
- export declare const Debug: {
34
- $type: "devvit.runtime.Debug";
35
- encode(message: Debug, writer?: _m0.Writer): _m0.Writer;
36
- decode(input: _m0.Reader | Uint8Array, length?: number): Debug;
37
- fromJSON(object: any): Debug;
38
- toJSON(message: Debug): unknown;
39
- create(base?: DeepPartial<Debug>): Debug;
40
- fromPartial(object: DeepPartial<Debug>): Debug;
41
- };
42
10
  export declare const Strings: {
43
11
  $type: "devvit.runtime.Strings";
44
12
  encode(message: Strings, writer?: _m0.Writer): _m0.Writer;
@@ -48,15 +16,6 @@ export declare const Strings: {
48
16
  create(base?: DeepPartial<Strings>): Strings;
49
17
  fromPartial(object: DeepPartial<Strings>): Strings;
50
18
  };
51
- export declare const Str: {
52
- $type: "devvit.runtime.Str";
53
- encode(message: Str, writer?: _m0.Writer): _m0.Writer;
54
- decode(input: _m0.Reader | Uint8Array, length?: number): Str;
55
- fromJSON(object: any): Str;
56
- toJSON(message: Str): unknown;
57
- create(base?: DeepPartial<Str>): Str;
58
- fromPartial(object: DeepPartial<Str>): Str;
59
- };
60
19
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
61
20
  type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
62
21
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime_common.d.ts","sourceRoot":"","sources":["../../../../src/types/devvit/runtime/runtime_common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,KAAK;IACpB,OAAO,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,eAAO,MAAM,GAAG;;oBAGE,GAAG,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAU5D,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,GAAG;qBA8B3C,GAAG,GAAG,GAAG;oBAOV,GAAG,GAAG,OAAO;kBAWf,YAAY,GAAG,CAAC,GAAG,GAAG;wBAGhB,YAAY,GAAG,CAAC,GAAG,GAAG;CAM3C,CAAC;AAQF,eAAO,MAAM,KAAK;;oBAGA,KAAK,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAO9D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