@devvit/protos 0.10.21-next-2024-05-13-e0c684b50.0 → 0.10.21-next-2024-05-13-376d4e59d.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -3
- package/schema/devvit/data/api/admin/v1alpha/auth.proto +1 -0
- package/schema/devvit/data/api/admin/v1alpha/organization.proto +9 -0
- package/schema/devvit/data/api/admin/v1alpha/service.proto +5 -0
- package/schema/devvit/data/api/admin/v1alpha/ui.proto +10 -42
- package/types/devvit/data/api/admin/v1alpha/auth.d.ts +1 -0
- package/types/devvit/data/api/admin/v1alpha/auth.d.ts.map +1 -1
- package/types/devvit/data/api/admin/v1alpha/auth.js +15 -1
- package/types/devvit/data/api/admin/v1alpha/organization.d.ts +24 -0
- package/types/devvit/data/api/admin/v1alpha/organization.d.ts.map +1 -1
- package/types/devvit/data/api/admin/v1alpha/organization.js +106 -0
- package/types/devvit/data/api/admin/v1alpha/service.d.ts +124 -2
- package/types/devvit/data/api/admin/v1alpha/service.d.ts.map +1 -1
- package/types/devvit/data/api/admin/v1alpha/service.js +31 -1
- package/types/devvit/data/api/admin/v1alpha/ui.d.ts +34 -128
- package/types/devvit/data/api/admin/v1alpha/ui.d.ts.map +1 -1
- package/types/devvit/data/api/admin/v1alpha/ui.js +66 -260
@@ -6,32 +6,24 @@
|
|
6
6
|
/* eslint-disable */
|
7
7
|
import _m0 from 'protobufjs/minimal.js';
|
8
8
|
import { messageTypeRegistry } from '../../../../../typeRegistry.js';
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
9
|
+
import { AccessToken } from './auth.js';
|
10
|
+
import { Organization } from './organization.js';
|
11
|
+
import { Subscription } from './subscription.js';
|
12
|
+
function createBaseUIGetOrganizationsRequest() {
|
13
|
+
return {};
|
13
14
|
}
|
14
|
-
export const
|
15
|
-
$type: "devvit.data.api.admin.v1alpha.
|
16
|
-
encode(
|
17
|
-
if (message.organizationName !== "") {
|
18
|
-
writer.uint32(10).string(message.organizationName);
|
19
|
-
}
|
15
|
+
export const UIGetOrganizationsRequest = {
|
16
|
+
$type: "devvit.data.api.admin.v1alpha.UIGetOrganizationsRequest",
|
17
|
+
encode(_, writer = _m0.Writer.create()) {
|
20
18
|
return writer;
|
21
19
|
},
|
22
20
|
decode(input, length) {
|
23
21
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
24
22
|
let end = length === undefined ? reader.len : reader.pos + length;
|
25
|
-
const message =
|
23
|
+
const message = createBaseUIGetOrganizationsRequest();
|
26
24
|
while (reader.pos < end) {
|
27
25
|
const tag = reader.uint32();
|
28
26
|
switch (tag >>> 3) {
|
29
|
-
case 1:
|
30
|
-
if (tag !== 10) {
|
31
|
-
break;
|
32
|
-
}
|
33
|
-
message.organizationName = reader.string();
|
34
|
-
continue;
|
35
27
|
}
|
36
28
|
if ((tag & 7) === 4 || tag === 0) {
|
37
29
|
break;
|
@@ -40,41 +32,37 @@ export const GetUISubscriptionsByOrganizationNameRequest = {
|
|
40
32
|
}
|
41
33
|
return message;
|
42
34
|
},
|
43
|
-
fromJSON(
|
44
|
-
return {
|
35
|
+
fromJSON(_) {
|
36
|
+
return {};
|
45
37
|
},
|
46
|
-
toJSON(
|
38
|
+
toJSON(_) {
|
47
39
|
const obj = {};
|
48
|
-
if (message.organizationName !== "") {
|
49
|
-
obj.organizationName = message.organizationName;
|
50
|
-
}
|
51
40
|
return obj;
|
52
41
|
},
|
53
42
|
create(base) {
|
54
|
-
return
|
43
|
+
return UIGetOrganizationsRequest.fromPartial(base ?? {});
|
55
44
|
},
|
56
|
-
fromPartial(
|
57
|
-
const message =
|
58
|
-
message.organizationName = object.organizationName ?? "";
|
45
|
+
fromPartial(_) {
|
46
|
+
const message = createBaseUIGetOrganizationsRequest();
|
59
47
|
return message;
|
60
48
|
},
|
61
49
|
};
|
62
|
-
messageTypeRegistry.set(
|
63
|
-
function
|
64
|
-
return {
|
50
|
+
messageTypeRegistry.set(UIGetOrganizationsRequest.$type, UIGetOrganizationsRequest);
|
51
|
+
function createBaseUIGetOrganizationsResponse() {
|
52
|
+
return { organizations: [] };
|
65
53
|
}
|
66
|
-
export const
|
67
|
-
$type: "devvit.data.api.admin.v1alpha.
|
54
|
+
export const UIGetOrganizationsResponse = {
|
55
|
+
$type: "devvit.data.api.admin.v1alpha.UIGetOrganizationsResponse",
|
68
56
|
encode(message, writer = _m0.Writer.create()) {
|
69
|
-
for (const v of message.
|
70
|
-
|
57
|
+
for (const v of message.organizations) {
|
58
|
+
UIGetOrganizationsResponse_HydratedOrganization.encode(v, writer.uint32(10).fork()).ldelim();
|
71
59
|
}
|
72
60
|
return writer;
|
73
61
|
},
|
74
62
|
decode(input, length) {
|
75
63
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
76
64
|
let end = length === undefined ? reader.len : reader.pos + length;
|
77
|
-
const message =
|
65
|
+
const message = createBaseUIGetOrganizationsResponse();
|
78
66
|
while (reader.pos < end) {
|
79
67
|
const tag = reader.uint32();
|
80
68
|
switch (tag >>> 3) {
|
@@ -82,7 +70,7 @@ export const GetUISubscriptionsByOrganizationNameResponse = {
|
|
82
70
|
if (tag !== 10) {
|
83
71
|
break;
|
84
72
|
}
|
85
|
-
message.
|
73
|
+
message.organizations.push(UIGetOrganizationsResponse_HydratedOrganization.decode(reader, reader.uint32()));
|
86
74
|
continue;
|
87
75
|
}
|
88
76
|
if ((tag & 7) === 4 || tag === 0) {
|
@@ -94,159 +82,50 @@ export const GetUISubscriptionsByOrganizationNameResponse = {
|
|
94
82
|
},
|
95
83
|
fromJSON(object) {
|
96
84
|
return {
|
97
|
-
|
98
|
-
? object.
|
85
|
+
organizations: globalThis.Array.isArray(object?.organizations)
|
86
|
+
? object.organizations.map((e) => UIGetOrganizationsResponse_HydratedOrganization.fromJSON(e))
|
99
87
|
: [],
|
100
88
|
};
|
101
89
|
},
|
102
90
|
toJSON(message) {
|
103
91
|
const obj = {};
|
104
|
-
if (message.
|
105
|
-
obj.
|
92
|
+
if (message.organizations?.length) {
|
93
|
+
obj.organizations = message.organizations.map((e) => UIGetOrganizationsResponse_HydratedOrganization.toJSON(e));
|
106
94
|
}
|
107
95
|
return obj;
|
108
96
|
},
|
109
97
|
create(base) {
|
110
|
-
return
|
98
|
+
return UIGetOrganizationsResponse.fromPartial(base ?? {});
|
111
99
|
},
|
112
100
|
fromPartial(object) {
|
113
|
-
const message =
|
114
|
-
message.
|
115
|
-
object.
|
101
|
+
const message = createBaseUIGetOrganizationsResponse();
|
102
|
+
message.organizations =
|
103
|
+
object.organizations?.map((e) => UIGetOrganizationsResponse_HydratedOrganization.fromPartial(e)) || [];
|
116
104
|
return message;
|
117
105
|
},
|
118
106
|
};
|
119
|
-
messageTypeRegistry.set(
|
120
|
-
function
|
121
|
-
return {
|
107
|
+
messageTypeRegistry.set(UIGetOrganizationsResponse.$type, UIGetOrganizationsResponse);
|
108
|
+
function createBaseUIGetOrganizationsResponse_HydratedOrganization() {
|
109
|
+
return { organization: undefined, subscriptions: [], acccessTokens: [] };
|
122
110
|
}
|
123
|
-
export const
|
124
|
-
$type: "devvit.data.api.admin.v1alpha.
|
111
|
+
export const UIGetOrganizationsResponse_HydratedOrganization = {
|
112
|
+
$type: "devvit.data.api.admin.v1alpha.UIGetOrganizationsResponse.HydratedOrganization",
|
125
113
|
encode(message, writer = _m0.Writer.create()) {
|
126
|
-
if (message.
|
127
|
-
writer.uint32(10).
|
128
|
-
}
|
129
|
-
if (message.name !== "") {
|
130
|
-
writer.uint32(18).string(message.name);
|
114
|
+
if (message.organization !== undefined) {
|
115
|
+
Organization.encode(message.organization, writer.uint32(10).fork()).ldelim();
|
131
116
|
}
|
132
|
-
|
133
|
-
writer.uint32(
|
134
|
-
}
|
135
|
-
if (message.isNsfw !== false) {
|
136
|
-
writer.uint32(32).bool(message.isNsfw);
|
137
|
-
}
|
138
|
-
return writer;
|
139
|
-
},
|
140
|
-
decode(input, length) {
|
141
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
142
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
143
|
-
const message = createBaseGetUISubscriptionsByOrganizationNameResponse_SubredditInfo();
|
144
|
-
while (reader.pos < end) {
|
145
|
-
const tag = reader.uint32();
|
146
|
-
switch (tag >>> 3) {
|
147
|
-
case 1:
|
148
|
-
if (tag !== 10) {
|
149
|
-
break;
|
150
|
-
}
|
151
|
-
message.id = reader.string();
|
152
|
-
continue;
|
153
|
-
case 2:
|
154
|
-
if (tag !== 18) {
|
155
|
-
break;
|
156
|
-
}
|
157
|
-
message.name = reader.string();
|
158
|
-
continue;
|
159
|
-
case 3:
|
160
|
-
if (tag !== 26) {
|
161
|
-
break;
|
162
|
-
}
|
163
|
-
message.icon = reader.string();
|
164
|
-
continue;
|
165
|
-
case 4:
|
166
|
-
if (tag !== 32) {
|
167
|
-
break;
|
168
|
-
}
|
169
|
-
message.isNsfw = reader.bool();
|
170
|
-
continue;
|
171
|
-
}
|
172
|
-
if ((tag & 7) === 4 || tag === 0) {
|
173
|
-
break;
|
174
|
-
}
|
175
|
-
reader.skipType(tag & 7);
|
176
|
-
}
|
177
|
-
return message;
|
178
|
-
},
|
179
|
-
fromJSON(object) {
|
180
|
-
return {
|
181
|
-
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
182
|
-
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
183
|
-
icon: isSet(object.icon) ? globalThis.String(object.icon) : "",
|
184
|
-
isNsfw: isSet(object.isNsfw) ? globalThis.Boolean(object.isNsfw) : false,
|
185
|
-
};
|
186
|
-
},
|
187
|
-
toJSON(message) {
|
188
|
-
const obj = {};
|
189
|
-
if (message.id !== "") {
|
190
|
-
obj.id = message.id;
|
191
|
-
}
|
192
|
-
if (message.name !== "") {
|
193
|
-
obj.name = message.name;
|
194
|
-
}
|
195
|
-
if (message.icon !== "") {
|
196
|
-
obj.icon = message.icon;
|
197
|
-
}
|
198
|
-
if (message.isNsfw !== false) {
|
199
|
-
obj.isNsfw = message.isNsfw;
|
200
|
-
}
|
201
|
-
return obj;
|
202
|
-
},
|
203
|
-
create(base) {
|
204
|
-
return GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.fromPartial(base ?? {});
|
205
|
-
},
|
206
|
-
fromPartial(object) {
|
207
|
-
const message = createBaseGetUISubscriptionsByOrganizationNameResponse_SubredditInfo();
|
208
|
-
message.id = object.id ?? "";
|
209
|
-
message.name = object.name ?? "";
|
210
|
-
message.icon = object.icon ?? "";
|
211
|
-
message.isNsfw = object.isNsfw ?? false;
|
212
|
-
return message;
|
213
|
-
},
|
214
|
-
};
|
215
|
-
messageTypeRegistry.set(GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.$type, GetUISubscriptionsByOrganizationNameResponse_SubredditInfo);
|
216
|
-
function createBaseGetUISubscriptionsByOrganizationNameResponse_Subscription() {
|
217
|
-
return { id: "", name: "", description: "", events: [], subreddits: [], subredditRatings: [] };
|
218
|
-
}
|
219
|
-
export const GetUISubscriptionsByOrganizationNameResponse_Subscription = {
|
220
|
-
$type: "devvit.data.api.admin.v1alpha.GetUISubscriptionsByOrganizationNameResponse.Subscription",
|
221
|
-
encode(message, writer = _m0.Writer.create()) {
|
222
|
-
if (message.id !== "") {
|
223
|
-
writer.uint32(10).string(message.id);
|
224
|
-
}
|
225
|
-
if (message.name !== "") {
|
226
|
-
writer.uint32(18).string(message.name);
|
227
|
-
}
|
228
|
-
if (message.description !== "") {
|
229
|
-
writer.uint32(26).string(message.description);
|
230
|
-
}
|
231
|
-
writer.uint32(34).fork();
|
232
|
-
for (const v of message.events) {
|
233
|
-
writer.int32(v);
|
234
|
-
}
|
235
|
-
writer.ldelim();
|
236
|
-
for (const v of message.subreddits) {
|
237
|
-
GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.encode(v, writer.uint32(42).fork()).ldelim();
|
117
|
+
for (const v of message.subscriptions) {
|
118
|
+
Subscription.encode(v, writer.uint32(18).fork()).ldelim();
|
238
119
|
}
|
239
|
-
|
240
|
-
|
241
|
-
writer.int32(v);
|
120
|
+
for (const v of message.acccessTokens) {
|
121
|
+
AccessToken.encode(v, writer.uint32(26).fork()).ldelim();
|
242
122
|
}
|
243
|
-
writer.ldelim();
|
244
123
|
return writer;
|
245
124
|
},
|
246
125
|
decode(input, length) {
|
247
126
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
248
127
|
let end = length === undefined ? reader.len : reader.pos + length;
|
249
|
-
const message =
|
128
|
+
const message = createBaseUIGetOrganizationsResponse_HydratedOrganization();
|
250
129
|
while (reader.pos < end) {
|
251
130
|
const tag = reader.uint32();
|
252
131
|
switch (tag >>> 3) {
|
@@ -254,52 +133,20 @@ export const GetUISubscriptionsByOrganizationNameResponse_Subscription = {
|
|
254
133
|
if (tag !== 10) {
|
255
134
|
break;
|
256
135
|
}
|
257
|
-
message.
|
136
|
+
message.organization = Organization.decode(reader, reader.uint32());
|
258
137
|
continue;
|
259
138
|
case 2:
|
260
139
|
if (tag !== 18) {
|
261
140
|
break;
|
262
141
|
}
|
263
|
-
message.
|
142
|
+
message.subscriptions.push(Subscription.decode(reader, reader.uint32()));
|
264
143
|
continue;
|
265
144
|
case 3:
|
266
145
|
if (tag !== 26) {
|
267
146
|
break;
|
268
147
|
}
|
269
|
-
message.
|
270
|
-
continue;
|
271
|
-
case 4:
|
272
|
-
if (tag === 32) {
|
273
|
-
message.events.push(reader.int32());
|
274
|
-
continue;
|
275
|
-
}
|
276
|
-
if (tag === 34) {
|
277
|
-
const end2 = reader.uint32() + reader.pos;
|
278
|
-
while (reader.pos < end2) {
|
279
|
-
message.events.push(reader.int32());
|
280
|
-
}
|
281
|
-
continue;
|
282
|
-
}
|
283
|
-
break;
|
284
|
-
case 5:
|
285
|
-
if (tag !== 42) {
|
286
|
-
break;
|
287
|
-
}
|
288
|
-
message.subreddits.push(GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.decode(reader, reader.uint32()));
|
148
|
+
message.acccessTokens.push(AccessToken.decode(reader, reader.uint32()));
|
289
149
|
continue;
|
290
|
-
case 6:
|
291
|
-
if (tag === 48) {
|
292
|
-
message.subredditRatings.push(reader.int32());
|
293
|
-
continue;
|
294
|
-
}
|
295
|
-
if (tag === 50) {
|
296
|
-
const end2 = reader.uint32() + reader.pos;
|
297
|
-
while (reader.pos < end2) {
|
298
|
-
message.subredditRatings.push(reader.int32());
|
299
|
-
}
|
300
|
-
continue;
|
301
|
-
}
|
302
|
-
break;
|
303
150
|
}
|
304
151
|
if ((tag & 7) === 4 || tag === 0) {
|
305
152
|
break;
|
@@ -310,83 +157,42 @@ export const GetUISubscriptionsByOrganizationNameResponse_Subscription = {
|
|
310
157
|
},
|
311
158
|
fromJSON(object) {
|
312
159
|
return {
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
events: globalThis.Array.isArray(object?.events) ? object.events.map((e) => firehoseEventFromJSON(e)) : [],
|
317
|
-
subreddits: globalThis.Array.isArray(object?.subreddits)
|
318
|
-
? object.subreddits.map((e) => GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.fromJSON(e))
|
160
|
+
organization: isSet(object.organization) ? Organization.fromJSON(object.organization) : undefined,
|
161
|
+
subscriptions: globalThis.Array.isArray(object?.subscriptions)
|
162
|
+
? object.subscriptions.map((e) => Subscription.fromJSON(e))
|
319
163
|
: [],
|
320
|
-
|
321
|
-
? object.
|
164
|
+
acccessTokens: globalThis.Array.isArray(object?.acccessTokens)
|
165
|
+
? object.acccessTokens.map((e) => AccessToken.fromJSON(e))
|
322
166
|
: [],
|
323
167
|
};
|
324
168
|
},
|
325
169
|
toJSON(message) {
|
326
170
|
const obj = {};
|
327
|
-
if (message.
|
328
|
-
obj.
|
329
|
-
}
|
330
|
-
if (message.name !== "") {
|
331
|
-
obj.name = message.name;
|
332
|
-
}
|
333
|
-
if (message.description !== "") {
|
334
|
-
obj.description = message.description;
|
171
|
+
if (message.organization !== undefined) {
|
172
|
+
obj.organization = Organization.toJSON(message.organization);
|
335
173
|
}
|
336
|
-
if (message.
|
337
|
-
obj.
|
338
|
-
}
|
339
|
-
if (message.subreddits?.length) {
|
340
|
-
obj.subreddits = message.subreddits.map((e) => GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.toJSON(e));
|
174
|
+
if (message.subscriptions?.length) {
|
175
|
+
obj.subscriptions = message.subscriptions.map((e) => Subscription.toJSON(e));
|
341
176
|
}
|
342
|
-
if (message.
|
343
|
-
obj.
|
177
|
+
if (message.acccessTokens?.length) {
|
178
|
+
obj.acccessTokens = message.acccessTokens.map((e) => AccessToken.toJSON(e));
|
344
179
|
}
|
345
180
|
return obj;
|
346
181
|
},
|
347
182
|
create(base) {
|
348
|
-
return
|
183
|
+
return UIGetOrganizationsResponse_HydratedOrganization.fromPartial(base ?? {});
|
349
184
|
},
|
350
185
|
fromPartial(object) {
|
351
|
-
const message =
|
352
|
-
message.
|
353
|
-
|
354
|
-
|
355
|
-
message.
|
356
|
-
message.
|
357
|
-
object.subreddits?.map((e) => GetUISubscriptionsByOrganizationNameResponse_SubredditInfo.fromPartial(e)) || [];
|
358
|
-
message.subredditRatings = object.subredditRatings?.map((e) => e) || [];
|
186
|
+
const message = createBaseUIGetOrganizationsResponse_HydratedOrganization();
|
187
|
+
message.organization = (object.organization !== undefined && object.organization !== null)
|
188
|
+
? Organization.fromPartial(object.organization)
|
189
|
+
: undefined;
|
190
|
+
message.subscriptions = object.subscriptions?.map((e) => Subscription.fromPartial(e)) || [];
|
191
|
+
message.acccessTokens = object.acccessTokens?.map((e) => AccessToken.fromPartial(e)) || [];
|
359
192
|
return message;
|
360
193
|
},
|
361
194
|
};
|
362
|
-
messageTypeRegistry.set(
|
363
|
-
export const ROAdminUIServiceName = "devvit.data.api.admin.v1alpha.ROAdminUI";
|
364
|
-
export class ROAdminUIClientImpl {
|
365
|
-
constructor(rpc, opts) {
|
366
|
-
this.service = opts?.service || ROAdminUIServiceName;
|
367
|
-
this.rpc = rpc;
|
368
|
-
this.GetSubscriptionsByOrganizationName = this.GetSubscriptionsByOrganizationName.bind(this);
|
369
|
-
}
|
370
|
-
GetSubscriptionsByOrganizationName(request, metadata) {
|
371
|
-
const data = GetUISubscriptionsByOrganizationNameRequest.encode(request).finish();
|
372
|
-
const promise = this.rpc.request(this.service, "GetSubscriptionsByOrganizationName", data, metadata);
|
373
|
-
return promise.then((data) => GetUISubscriptionsByOrganizationNameResponse.decode(_m0.Reader.create(data)));
|
374
|
-
}
|
375
|
-
}
|
376
|
-
export const ROAdminUIDefinition = {
|
377
|
-
name: "ROAdminUI",
|
378
|
-
fullName: "devvit.data.api.admin.v1alpha.ROAdminUI",
|
379
|
-
methods: {
|
380
|
-
getSubscriptionsByOrganizationName: {
|
381
|
-
name: "GetSubscriptionsByOrganizationName",
|
382
|
-
requestType: GetUISubscriptionsByOrganizationNameRequest,
|
383
|
-
requestStream: false,
|
384
|
-
responseType: GetUISubscriptionsByOrganizationNameResponse,
|
385
|
-
responseStream: false,
|
386
|
-
options: {},
|
387
|
-
},
|
388
|
-
},
|
389
|
-
};
|
195
|
+
messageTypeRegistry.set(UIGetOrganizationsResponse_HydratedOrganization.$type, UIGetOrganizationsResponse_HydratedOrganization);
|
390
196
|
function isSet(value) {
|
391
197
|
return value !== null && value !== undefined;
|
392
198
|
}
|