@devvit/protos 0.12.9-next-2026-01-14-17-50-38-19ca36734.0 → 0.12.9-next-2026-01-14-22-04-36-ea564a40f.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/community.d.ts +0 -1
  2. package/community.d.ts.map +1 -1
  3. package/community.js +0 -1
  4. package/index.d.ts +0 -2
  5. package/index.d.ts.map +1 -1
  6. package/index.js +0 -1
  7. package/json/devvit/dev_portal/nutrition/nutrition.d.ts +1 -0
  8. package/json/devvit/dev_portal/nutrition/nutrition.d.ts.map +1 -1
  9. package/json/devvit/dev_portal/nutrition/nutrition.js +1 -0
  10. package/lib/Defunct-Types.d.ts +5 -0
  11. package/lib/Defunct-Types.d.ts.map +1 -1
  12. package/lib/Defunct-Types.js +6 -0
  13. package/meta.min.json +5 -34
  14. package/package.json +4 -4
  15. package/protos.min.js +1 -1
  16. package/protos.min.js.map +4 -4
  17. package/schema/devvit/dev_portal/nutrition/nutrition.proto +1 -0
  18. package/schema/snootobuf.lock +0 -0
  19. package/schema/snootobuf.redditapi.lock +0 -0
  20. package/types/devvit/dev_portal/nutrition/nutrition.d.ts +1 -0
  21. package/types/devvit/dev_portal/nutrition/nutrition.d.ts.map +1 -1
  22. package/types/devvit/dev_portal/nutrition/nutrition.js +1 -0
  23. package/json/devvit/plugin/modlog/modlog.d.ts +0 -23
  24. package/json/devvit/plugin/modlog/modlog.d.ts.map +0 -1
  25. package/json/devvit/plugin/modlog/modlog.js +0 -8
  26. package/json/devvit/plugin/v2events/v2events.d.ts +0 -23
  27. package/json/devvit/plugin/v2events/v2events.d.ts.map +0 -1
  28. package/json/devvit/plugin/v2events/v2events.js +0 -8
  29. package/schema/devvit/plugin/modlog/modlog.proto +0 -31
  30. package/schema/devvit/plugin/v2events/v2events.proto +0 -43
  31. package/types/devvit/plugin/modlog/modlog.d.ts +0 -102
  32. package/types/devvit/plugin/modlog/modlog.d.ts.map +0 -1
  33. package/types/devvit/plugin/modlog/modlog.js +0 -201
  34. package/types/devvit/plugin/modlog/modlog.twirp-client.d.ts +0 -19
  35. package/types/devvit/plugin/modlog/modlog.twirp-client.d.ts.map +0 -1
  36. package/types/devvit/plugin/modlog/modlog.twirp-client.js +0 -23
  37. package/types/devvit/plugin/modlog/modlog.twirp.d.ts +0 -11
  38. package/types/devvit/plugin/modlog/modlog.twirp.d.ts.map +0 -1
  39. package/types/devvit/plugin/modlog/modlog.twirp.js +0 -88
  40. package/types/devvit/plugin/v2events/v2events.d.ts +0 -124
  41. package/types/devvit/plugin/v2events/v2events.d.ts.map +0 -1
  42. package/types/devvit/plugin/v2events/v2events.js +0 -330
  43. package/types/devvit/plugin/v2events/v2events.twirp-client.d.ts +0 -19
  44. package/types/devvit/plugin/v2events/v2events.twirp-client.d.ts.map +0 -1
  45. package/types/devvit/plugin/v2events/v2events.twirp-client.js +0 -23
  46. package/types/devvit/plugin/v2events/v2events.twirp.d.ts +0 -11
  47. package/types/devvit/plugin/v2events/v2events.twirp.d.ts.map +0 -1
  48. package/types/devvit/plugin/v2events/v2events.twirp.js +0 -88
@@ -1,124 +0,0 @@
1
- /**
2
- * #v2events.ts
3
- *
4
- * Code generated by ts-proto. DO NOT EDIT.
5
- * @packageDocumentation
6
- */
7
- import _m0 from "protobufjs/minimal.js";
8
- import { Metadata } from "../../../../lib/Types.js";
9
- export interface V2EventsActionInfo {
10
- pageType: string;
11
- paneName: string;
12
- }
13
- export interface V2EventsPostGuidanceCreate {
14
- actionInfo?: V2EventsActionInfo | undefined;
15
- }
16
- export interface V2EventsPostGuidanceUpdate {
17
- actionInfo?: V2EventsActionInfo | undefined;
18
- }
19
- export interface V2EventsPublishRequest {
20
- postGuidanceCreate?: V2EventsPostGuidanceCreate | undefined;
21
- postGuidanceUpdate?: V2EventsPostGuidanceUpdate | undefined;
22
- }
23
- /** Generic response interface */
24
- export interface V2EventsPublishResponse {
25
- }
26
- export declare const V2EventsActionInfo: {
27
- $type: "devvit.plugin.v2events.V2EventsActionInfo";
28
- encode(message: V2EventsActionInfo, writer?: _m0.Writer): _m0.Writer;
29
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsActionInfo;
30
- fromJSON(object: any): V2EventsActionInfo;
31
- toJSON(message: V2EventsActionInfo): unknown;
32
- create(base?: DeepPartial<V2EventsActionInfo>): V2EventsActionInfo;
33
- fromPartial(object: DeepPartial<V2EventsActionInfo>): V2EventsActionInfo;
34
- };
35
- export declare const V2EventsPostGuidanceCreate: {
36
- $type: "devvit.plugin.v2events.V2EventsPostGuidanceCreate";
37
- encode(message: V2EventsPostGuidanceCreate, writer?: _m0.Writer): _m0.Writer;
38
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPostGuidanceCreate;
39
- fromJSON(object: any): V2EventsPostGuidanceCreate;
40
- toJSON(message: V2EventsPostGuidanceCreate): unknown;
41
- create(base?: DeepPartial<V2EventsPostGuidanceCreate>): V2EventsPostGuidanceCreate;
42
- fromPartial(object: DeepPartial<V2EventsPostGuidanceCreate>): V2EventsPostGuidanceCreate;
43
- };
44
- export declare const V2EventsPostGuidanceUpdate: {
45
- $type: "devvit.plugin.v2events.V2EventsPostGuidanceUpdate";
46
- encode(message: V2EventsPostGuidanceUpdate, writer?: _m0.Writer): _m0.Writer;
47
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPostGuidanceUpdate;
48
- fromJSON(object: any): V2EventsPostGuidanceUpdate;
49
- toJSON(message: V2EventsPostGuidanceUpdate): unknown;
50
- create(base?: DeepPartial<V2EventsPostGuidanceUpdate>): V2EventsPostGuidanceUpdate;
51
- fromPartial(object: DeepPartial<V2EventsPostGuidanceUpdate>): V2EventsPostGuidanceUpdate;
52
- };
53
- export declare const V2EventsPublishRequest: {
54
- $type: "devvit.plugin.v2events.V2EventsPublishRequest";
55
- encode(message: V2EventsPublishRequest, writer?: _m0.Writer): _m0.Writer;
56
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPublishRequest;
57
- fromJSON(object: any): V2EventsPublishRequest;
58
- toJSON(message: V2EventsPublishRequest): unknown;
59
- create(base?: DeepPartial<V2EventsPublishRequest>): V2EventsPublishRequest;
60
- fromPartial(object: DeepPartial<V2EventsPublishRequest>): V2EventsPublishRequest;
61
- };
62
- export declare const V2EventsPublishResponse: {
63
- $type: "devvit.plugin.v2events.V2EventsPublishResponse";
64
- encode(_: V2EventsPublishResponse, writer?: _m0.Writer): _m0.Writer;
65
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPublishResponse;
66
- fromJSON(_: any): V2EventsPublishResponse;
67
- toJSON(_: V2EventsPublishResponse): unknown;
68
- create(base?: DeepPartial<V2EventsPublishResponse>): V2EventsPublishResponse;
69
- fromPartial(_: DeepPartial<V2EventsPublishResponse>): V2EventsPublishResponse;
70
- };
71
- /** The Events plugin allows an app to emit pre-defined v2 events */
72
- export interface V2Events {
73
- Publish(request: V2EventsPublishRequest, metadata?: Metadata): Promise<V2EventsPublishResponse>;
74
- }
75
- export declare const V2EventsServiceName = "devvit.plugin.v2events.V2Events";
76
- export declare class V2EventsClientImpl implements V2Events {
77
- private readonly rpc;
78
- private readonly service;
79
- constructor(rpc: Rpc, opts?: {
80
- service?: string;
81
- });
82
- Publish(request: V2EventsPublishRequest, metadata?: Metadata): Promise<V2EventsPublishResponse>;
83
- }
84
- /** The Events plugin allows an app to emit pre-defined v2 events */
85
- export type V2EventsDefinition = typeof V2EventsDefinition;
86
- export declare const V2EventsDefinition: {
87
- readonly name: "V2Events";
88
- readonly fullName: "devvit.plugin.v2events.V2Events";
89
- readonly methods: {
90
- readonly publish: {
91
- readonly name: "Publish";
92
- readonly requestType: {
93
- $type: "devvit.plugin.v2events.V2EventsPublishRequest";
94
- encode(message: V2EventsPublishRequest, writer?: _m0.Writer): _m0.Writer;
95
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPublishRequest;
96
- fromJSON(object: any): V2EventsPublishRequest;
97
- toJSON(message: V2EventsPublishRequest): unknown;
98
- create(base?: DeepPartial<V2EventsPublishRequest>): V2EventsPublishRequest;
99
- fromPartial(object: DeepPartial<V2EventsPublishRequest>): V2EventsPublishRequest;
100
- };
101
- readonly requestStream: false;
102
- readonly responseType: {
103
- $type: "devvit.plugin.v2events.V2EventsPublishResponse";
104
- encode(_: V2EventsPublishResponse, writer?: _m0.Writer): _m0.Writer;
105
- decode(input: _m0.Reader | Uint8Array, length?: number): V2EventsPublishResponse;
106
- fromJSON(_: any): V2EventsPublishResponse;
107
- toJSON(_: V2EventsPublishResponse): unknown;
108
- create(base?: DeepPartial<V2EventsPublishResponse>): V2EventsPublishResponse;
109
- fromPartial(_: DeepPartial<V2EventsPublishResponse>): V2EventsPublishResponse;
110
- };
111
- readonly responseStream: false;
112
- readonly options: {};
113
- };
114
- };
115
- };
116
- interface Rpc {
117
- request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
118
- }
119
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
120
- 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 {} ? {
121
- [K in keyof T]?: DeepPartial<T[K]>;
122
- } : Partial<T>;
123
- export {};
124
- //# sourceMappingURL=v2events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v2events.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/plugin/v2events/v2events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAC7C;AAED,MAAM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,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACrD,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -1,330 +0,0 @@
1
- /**
2
- * #v2events.ts
3
- *
4
- * Code generated by ts-proto. DO NOT EDIT.
5
- * @packageDocumentation
6
- */
7
- /* eslint-disable */
8
- import _m0 from "protobufjs/minimal.js";
9
- import { messageTypeRegistry } from "../../../typeRegistry.js";
10
- function createBaseV2EventsActionInfo() {
11
- return { pageType: "", paneName: "" };
12
- }
13
- export const V2EventsActionInfo = {
14
- $type: "devvit.plugin.v2events.V2EventsActionInfo",
15
- encode(message, writer = _m0.Writer.create()) {
16
- if (message.pageType !== "") {
17
- writer.uint32(10).string(message.pageType);
18
- }
19
- if (message.paneName !== "") {
20
- writer.uint32(18).string(message.paneName);
21
- }
22
- return writer;
23
- },
24
- decode(input, length) {
25
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
26
- let end = length === undefined ? reader.len : reader.pos + length;
27
- const message = createBaseV2EventsActionInfo();
28
- while (reader.pos < end) {
29
- const tag = reader.uint32();
30
- switch (tag >>> 3) {
31
- case 1:
32
- if (tag !== 10) {
33
- break;
34
- }
35
- message.pageType = reader.string();
36
- continue;
37
- case 2:
38
- if (tag !== 18) {
39
- break;
40
- }
41
- message.paneName = reader.string();
42
- continue;
43
- }
44
- if ((tag & 7) === 4 || tag === 0) {
45
- break;
46
- }
47
- reader.skipType(tag & 7);
48
- }
49
- return message;
50
- },
51
- fromJSON(object) {
52
- return {
53
- pageType: isSet(object.pageType) ? globalThis.String(object.pageType) : "",
54
- paneName: isSet(object.paneName) ? globalThis.String(object.paneName) : "",
55
- };
56
- },
57
- toJSON(message) {
58
- const obj = {};
59
- if (message.pageType !== "") {
60
- obj.pageType = message.pageType;
61
- }
62
- if (message.paneName !== "") {
63
- obj.paneName = message.paneName;
64
- }
65
- return obj;
66
- },
67
- create(base) {
68
- return V2EventsActionInfo.fromPartial(base ?? {});
69
- },
70
- fromPartial(object) {
71
- const message = createBaseV2EventsActionInfo();
72
- message.pageType = object.pageType ?? "";
73
- message.paneName = object.paneName ?? "";
74
- return message;
75
- },
76
- };
77
- messageTypeRegistry.set(V2EventsActionInfo.$type, V2EventsActionInfo);
78
- function createBaseV2EventsPostGuidanceCreate() {
79
- return { actionInfo: undefined };
80
- }
81
- export const V2EventsPostGuidanceCreate = {
82
- $type: "devvit.plugin.v2events.V2EventsPostGuidanceCreate",
83
- encode(message, writer = _m0.Writer.create()) {
84
- if (message.actionInfo !== undefined) {
85
- V2EventsActionInfo.encode(message.actionInfo, writer.uint32(10).fork()).ldelim();
86
- }
87
- return writer;
88
- },
89
- decode(input, length) {
90
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
91
- let end = length === undefined ? reader.len : reader.pos + length;
92
- const message = createBaseV2EventsPostGuidanceCreate();
93
- while (reader.pos < end) {
94
- const tag = reader.uint32();
95
- switch (tag >>> 3) {
96
- case 1:
97
- if (tag !== 10) {
98
- break;
99
- }
100
- message.actionInfo = V2EventsActionInfo.decode(reader, reader.uint32());
101
- continue;
102
- }
103
- if ((tag & 7) === 4 || tag === 0) {
104
- break;
105
- }
106
- reader.skipType(tag & 7);
107
- }
108
- return message;
109
- },
110
- fromJSON(object) {
111
- return { actionInfo: isSet(object.actionInfo) ? V2EventsActionInfo.fromJSON(object.actionInfo) : undefined };
112
- },
113
- toJSON(message) {
114
- const obj = {};
115
- if (message.actionInfo !== undefined) {
116
- obj.actionInfo = V2EventsActionInfo.toJSON(message.actionInfo);
117
- }
118
- return obj;
119
- },
120
- create(base) {
121
- return V2EventsPostGuidanceCreate.fromPartial(base ?? {});
122
- },
123
- fromPartial(object) {
124
- const message = createBaseV2EventsPostGuidanceCreate();
125
- message.actionInfo = (object.actionInfo !== undefined && object.actionInfo !== null)
126
- ? V2EventsActionInfo.fromPartial(object.actionInfo)
127
- : undefined;
128
- return message;
129
- },
130
- };
131
- messageTypeRegistry.set(V2EventsPostGuidanceCreate.$type, V2EventsPostGuidanceCreate);
132
- function createBaseV2EventsPostGuidanceUpdate() {
133
- return { actionInfo: undefined };
134
- }
135
- export const V2EventsPostGuidanceUpdate = {
136
- $type: "devvit.plugin.v2events.V2EventsPostGuidanceUpdate",
137
- encode(message, writer = _m0.Writer.create()) {
138
- if (message.actionInfo !== undefined) {
139
- V2EventsActionInfo.encode(message.actionInfo, writer.uint32(10).fork()).ldelim();
140
- }
141
- return writer;
142
- },
143
- decode(input, length) {
144
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
145
- let end = length === undefined ? reader.len : reader.pos + length;
146
- const message = createBaseV2EventsPostGuidanceUpdate();
147
- while (reader.pos < end) {
148
- const tag = reader.uint32();
149
- switch (tag >>> 3) {
150
- case 1:
151
- if (tag !== 10) {
152
- break;
153
- }
154
- message.actionInfo = V2EventsActionInfo.decode(reader, reader.uint32());
155
- continue;
156
- }
157
- if ((tag & 7) === 4 || tag === 0) {
158
- break;
159
- }
160
- reader.skipType(tag & 7);
161
- }
162
- return message;
163
- },
164
- fromJSON(object) {
165
- return { actionInfo: isSet(object.actionInfo) ? V2EventsActionInfo.fromJSON(object.actionInfo) : undefined };
166
- },
167
- toJSON(message) {
168
- const obj = {};
169
- if (message.actionInfo !== undefined) {
170
- obj.actionInfo = V2EventsActionInfo.toJSON(message.actionInfo);
171
- }
172
- return obj;
173
- },
174
- create(base) {
175
- return V2EventsPostGuidanceUpdate.fromPartial(base ?? {});
176
- },
177
- fromPartial(object) {
178
- const message = createBaseV2EventsPostGuidanceUpdate();
179
- message.actionInfo = (object.actionInfo !== undefined && object.actionInfo !== null)
180
- ? V2EventsActionInfo.fromPartial(object.actionInfo)
181
- : undefined;
182
- return message;
183
- },
184
- };
185
- messageTypeRegistry.set(V2EventsPostGuidanceUpdate.$type, V2EventsPostGuidanceUpdate);
186
- function createBaseV2EventsPublishRequest() {
187
- return { postGuidanceCreate: undefined, postGuidanceUpdate: undefined };
188
- }
189
- export const V2EventsPublishRequest = {
190
- $type: "devvit.plugin.v2events.V2EventsPublishRequest",
191
- encode(message, writer = _m0.Writer.create()) {
192
- if (message.postGuidanceCreate !== undefined) {
193
- V2EventsPostGuidanceCreate.encode(message.postGuidanceCreate, writer.uint32(10).fork()).ldelim();
194
- }
195
- if (message.postGuidanceUpdate !== undefined) {
196
- V2EventsPostGuidanceUpdate.encode(message.postGuidanceUpdate, writer.uint32(18).fork()).ldelim();
197
- }
198
- return writer;
199
- },
200
- decode(input, length) {
201
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
202
- let end = length === undefined ? reader.len : reader.pos + length;
203
- const message = createBaseV2EventsPublishRequest();
204
- while (reader.pos < end) {
205
- const tag = reader.uint32();
206
- switch (tag >>> 3) {
207
- case 1:
208
- if (tag !== 10) {
209
- break;
210
- }
211
- message.postGuidanceCreate = V2EventsPostGuidanceCreate.decode(reader, reader.uint32());
212
- continue;
213
- case 2:
214
- if (tag !== 18) {
215
- break;
216
- }
217
- message.postGuidanceUpdate = V2EventsPostGuidanceUpdate.decode(reader, reader.uint32());
218
- continue;
219
- }
220
- if ((tag & 7) === 4 || tag === 0) {
221
- break;
222
- }
223
- reader.skipType(tag & 7);
224
- }
225
- return message;
226
- },
227
- fromJSON(object) {
228
- return {
229
- postGuidanceCreate: isSet(object.postGuidanceCreate)
230
- ? V2EventsPostGuidanceCreate.fromJSON(object.postGuidanceCreate)
231
- : undefined,
232
- postGuidanceUpdate: isSet(object.postGuidanceUpdate)
233
- ? V2EventsPostGuidanceUpdate.fromJSON(object.postGuidanceUpdate)
234
- : undefined,
235
- };
236
- },
237
- toJSON(message) {
238
- const obj = {};
239
- if (message.postGuidanceCreate !== undefined) {
240
- obj.postGuidanceCreate = V2EventsPostGuidanceCreate.toJSON(message.postGuidanceCreate);
241
- }
242
- if (message.postGuidanceUpdate !== undefined) {
243
- obj.postGuidanceUpdate = V2EventsPostGuidanceUpdate.toJSON(message.postGuidanceUpdate);
244
- }
245
- return obj;
246
- },
247
- create(base) {
248
- return V2EventsPublishRequest.fromPartial(base ?? {});
249
- },
250
- fromPartial(object) {
251
- const message = createBaseV2EventsPublishRequest();
252
- message.postGuidanceCreate = (object.postGuidanceCreate !== undefined && object.postGuidanceCreate !== null)
253
- ? V2EventsPostGuidanceCreate.fromPartial(object.postGuidanceCreate)
254
- : undefined;
255
- message.postGuidanceUpdate = (object.postGuidanceUpdate !== undefined && object.postGuidanceUpdate !== null)
256
- ? V2EventsPostGuidanceUpdate.fromPartial(object.postGuidanceUpdate)
257
- : undefined;
258
- return message;
259
- },
260
- };
261
- messageTypeRegistry.set(V2EventsPublishRequest.$type, V2EventsPublishRequest);
262
- function createBaseV2EventsPublishResponse() {
263
- return {};
264
- }
265
- export const V2EventsPublishResponse = {
266
- $type: "devvit.plugin.v2events.V2EventsPublishResponse",
267
- encode(_, writer = _m0.Writer.create()) {
268
- return writer;
269
- },
270
- decode(input, length) {
271
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
272
- let end = length === undefined ? reader.len : reader.pos + length;
273
- const message = createBaseV2EventsPublishResponse();
274
- while (reader.pos < end) {
275
- const tag = reader.uint32();
276
- switch (tag >>> 3) {
277
- }
278
- if ((tag & 7) === 4 || tag === 0) {
279
- break;
280
- }
281
- reader.skipType(tag & 7);
282
- }
283
- return message;
284
- },
285
- fromJSON(_) {
286
- return {};
287
- },
288
- toJSON(_) {
289
- const obj = {};
290
- return obj;
291
- },
292
- create(base) {
293
- return V2EventsPublishResponse.fromPartial(base ?? {});
294
- },
295
- fromPartial(_) {
296
- const message = createBaseV2EventsPublishResponse();
297
- return message;
298
- },
299
- };
300
- messageTypeRegistry.set(V2EventsPublishResponse.$type, V2EventsPublishResponse);
301
- export const V2EventsServiceName = "devvit.plugin.v2events.V2Events";
302
- export class V2EventsClientImpl {
303
- constructor(rpc, opts) {
304
- this.service = opts?.service || V2EventsServiceName;
305
- this.rpc = rpc;
306
- this.Publish = this.Publish.bind(this);
307
- }
308
- Publish(request, metadata) {
309
- const data = V2EventsPublishRequest.encode(request).finish();
310
- const promise = this.rpc.request(this.service, "Publish", data, metadata);
311
- return promise.then((data) => V2EventsPublishResponse.decode(_m0.Reader.create(data)));
312
- }
313
- }
314
- export const V2EventsDefinition = {
315
- name: "V2Events",
316
- fullName: "devvit.plugin.v2events.V2Events",
317
- methods: {
318
- publish: {
319
- name: "Publish",
320
- requestType: V2EventsPublishRequest,
321
- requestStream: false,
322
- responseType: V2EventsPublishResponse,
323
- responseStream: false,
324
- options: {},
325
- },
326
- },
327
- };
328
- function isSet(value) {
329
- return value !== null && value !== undefined;
330
- }
@@ -1,19 +0,0 @@
1
- import { V2EventsPublishRequest, V2EventsPublishResponse } from './v2events.js';
2
- interface Rpc {
3
- request(service: string, method: string, contentType: 'application/json' | 'application/protobuf', data: object | Uint8Array): Promise<object | Uint8Array>;
4
- }
5
- export interface V2EventsClient {
6
- Publish(request: V2EventsPublishRequest): Promise<V2EventsPublishResponse>;
7
- }
8
- export declare class V2EventsClientJSON implements V2EventsClient {
9
- private readonly rpc;
10
- constructor(rpc: Rpc);
11
- Publish(request: V2EventsPublishRequest): Promise<V2EventsPublishResponse>;
12
- }
13
- export declare class V2EventsClientProtobuf implements V2EventsClient {
14
- private readonly rpc;
15
- constructor(rpc: Rpc);
16
- Publish(request: V2EventsPublishRequest): Promise<V2EventsPublishResponse>;
17
- }
18
- export {};
19
- //# sourceMappingURL=v2events.twirp-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v2events.twirp-client.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/plugin/v2events/v2events.twirp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAMhF,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,cAAc;IAC7B,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC5E;AAED,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAY3E;AAED,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAY3E"}
@@ -1,23 +0,0 @@
1
- import { V2EventsPublishRequest, V2EventsPublishResponse } from './v2events.js';
2
- export class V2EventsClientJSON {
3
- constructor(rpc) {
4
- this.rpc = rpc;
5
- this.Publish.bind(this);
6
- }
7
- Publish(request) {
8
- const data = V2EventsPublishRequest.toJSON(request);
9
- const promise = this.rpc.request('devvit.plugin.v2events.V2Events', 'Publish', 'application/json', data);
10
- return promise.then((data) => V2EventsPublishResponse.fromJSON(data));
11
- }
12
- }
13
- export class V2EventsClientProtobuf {
14
- constructor(rpc) {
15
- this.rpc = rpc;
16
- this.Publish.bind(this);
17
- }
18
- Publish(request) {
19
- const data = V2EventsPublishRequest.encode(request).finish();
20
- const promise = this.rpc.request('devvit.plugin.v2events.V2Events', 'Publish', 'application/protobuf', data);
21
- return promise.then((data) => V2EventsPublishResponse.decode(data));
22
- }
23
- }
@@ -1,11 +0,0 @@
1
- import { TwirpContext, TwirpServer } from 'twirp-ts';
2
- import { V2EventsPublishRequest, V2EventsPublishResponse } from './v2events.js';
3
- export interface V2EventsTwirp<T extends TwirpContext = TwirpContext> {
4
- Publish(ctx: T, request: V2EventsPublishRequest): Promise<V2EventsPublishResponse>;
5
- }
6
- export declare enum V2EventsMethod {
7
- Publish = "Publish"
8
- }
9
- export declare const V2EventsMethodList: V2EventsMethod[];
10
- export declare function createV2EventsServer<T extends TwirpContext = TwirpContext>(service: V2EventsTwirp<T>): TwirpServer<V2EventsTwirp<TwirpContext<import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>>>, T>;
11
- //# sourceMappingURL=v2events.twirp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v2events.twirp.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/plugin/v2events/v2events.twirp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EAOZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAMhF,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAClE,OAAO,CACL,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACrC;AAED,oBAAY,cAAc;IACxB,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,kBAAkB,kBAA2B,CAAC;AAE3D,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACxE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,8IAS1B"}
@@ -1,88 +0,0 @@
1
- import { TwirpServer, TwirpError, TwirpErrorCode, TwirpContentType, chainInterceptors, } from 'twirp-ts';
2
- import { V2EventsPublishRequest, V2EventsPublishResponse } from './v2events.js';
3
- export var V2EventsMethod;
4
- (function (V2EventsMethod) {
5
- V2EventsMethod["Publish"] = "Publish";
6
- })(V2EventsMethod || (V2EventsMethod = {}));
7
- export const V2EventsMethodList = [V2EventsMethod.Publish];
8
- export function createV2EventsServer(service) {
9
- return new TwirpServer({
10
- service,
11
- packageName: 'devvit.plugin.v2events',
12
- serviceName: 'V2Events',
13
- methodList: V2EventsMethodList,
14
- matchRoute: matchV2EventsRoute,
15
- });
16
- }
17
- function matchV2EventsRoute(method, events) {
18
- switch (method) {
19
- case 'Publish':
20
- return async (ctx, service, data, interceptors) => {
21
- ctx = { ...ctx, methodName: 'Publish' };
22
- await events.onMatch(ctx);
23
- return handleV2EventsPublishRequest(ctx, service, data, interceptors);
24
- };
25
- default:
26
- events.onNotFound();
27
- const msg = `no handler found`;
28
- throw new TwirpError(TwirpErrorCode.BadRoute, msg);
29
- }
30
- }
31
- function handleV2EventsPublishRequest(ctx, service, data, interceptors) {
32
- switch (ctx.contentType) {
33
- case TwirpContentType.JSON:
34
- return handleV2EventsPublishJSON(ctx, service, data, interceptors);
35
- case TwirpContentType.Protobuf:
36
- return handleV2EventsPublishProtobuf(ctx, service, data, interceptors);
37
- default:
38
- const msg = 'unexpected Content-Type';
39
- throw new TwirpError(TwirpErrorCode.BadRoute, msg);
40
- }
41
- }
42
- async function handleV2EventsPublishJSON(ctx, service, data, interceptors) {
43
- let request;
44
- let response;
45
- try {
46
- const body = JSON.parse(data.toString() || '{}');
47
- request = V2EventsPublishRequest.fromJSON(body);
48
- }
49
- catch (e) {
50
- if (e instanceof Error) {
51
- const msg = 'the json request could not be decoded';
52
- throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
53
- }
54
- }
55
- if (interceptors && interceptors.length > 0) {
56
- const interceptor = chainInterceptors(...interceptors);
57
- response = await interceptor(ctx, request, (ctx, inputReq) => {
58
- return service.Publish(ctx, inputReq);
59
- });
60
- }
61
- else {
62
- response = await service.Publish(ctx, request);
63
- }
64
- return JSON.stringify(V2EventsPublishResponse.toJSON(response));
65
- }
66
- async function handleV2EventsPublishProtobuf(ctx, service, data, interceptors) {
67
- let request;
68
- let response;
69
- try {
70
- request = V2EventsPublishRequest.decode(data);
71
- }
72
- catch (e) {
73
- if (e instanceof Error) {
74
- const msg = 'the protobuf request could not be decoded';
75
- throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
76
- }
77
- }
78
- if (interceptors && interceptors.length > 0) {
79
- const interceptor = chainInterceptors(...interceptors);
80
- response = await interceptor(ctx, request, (ctx, inputReq) => {
81
- return service.Publish(ctx, inputReq);
82
- });
83
- }
84
- else {
85
- response = await service.Publish(ctx, request);
86
- }
87
- return Buffer.from(V2EventsPublishResponse.encode(response).finish());
88
- }