@devvit/protos 0.12.0-next-2025-04-10-eddbfb660.0 → 0.12.0-next-2025-04-24-137462f28.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 (35) hide show
  1. package/community.d.ts +1 -0
  2. package/community.d.ts.map +1 -1
  3. package/community.js +1 -0
  4. package/meta.min.json +6 -6
  5. package/package.json +5 -5
  6. package/protos.min.js +1 -1
  7. package/protos.min.js.map +2 -2
  8. package/schema/devvit/dev_portal/dev_portal.proto +8 -0
  9. package/schema/devvit/dev_portal/developer_account/developer_account.proto +46 -0
  10. package/schema/devvit/plugin/redditapi/common/common_msg.proto +1 -0
  11. package/schema/devvit/ui/effects/web_view/v1alpha/post_message.proto +4 -2
  12. package/schema/snootobuf.devenv.lock +1487 -415
  13. package/schema/snootobuf.lock +1488 -415
  14. package/schema/snootobuf.redditapi.lock +1486 -415
  15. package/schema/snootobuf.ts.lock +1487 -415
  16. package/types/devvit/dev_portal/dev_portal.d.ts +119 -7
  17. package/types/devvit/dev_portal/dev_portal.d.ts.map +1 -1
  18. package/types/devvit/dev_portal/dev_portal.js +42 -0
  19. package/types/devvit/dev_portal/dev_portal.twirp-client.d.ts +20 -0
  20. package/types/devvit/dev_portal/dev_portal.twirp-client.d.ts.map +1 -1
  21. package/types/devvit/dev_portal/dev_portal.twirp-client.js +35 -0
  22. package/types/devvit/dev_portal/dev_portal.twirp.d.ts +11 -0
  23. package/types/devvit/dev_portal/dev_portal.twirp.d.ts.map +1 -1
  24. package/types/devvit/dev_portal/dev_portal.twirp.js +155 -0
  25. package/types/devvit/dev_portal/developer_account/developer_account.d.ts +74 -0
  26. package/types/devvit/dev_portal/developer_account/developer_account.d.ts.map +1 -0
  27. package/types/devvit/dev_portal/developer_account/developer_account.js +394 -0
  28. package/types/devvit/plugin/redditapi/common/common_msg.d.ts +1 -0
  29. package/types/devvit/plugin/redditapi/common/common_msg.d.ts.map +1 -1
  30. package/types/devvit/plugin/redditapi/common/common_msg.js +6 -0
  31. package/types/devvit/plugin/redditapi/moderation/moderation_svc.d.ts +1 -1
  32. package/types/devvit/plugin/redditapi/moderation/moderation_svc.d.ts.map +1 -1
  33. package/types/devvit/ui/effects/web_view/v1alpha/post_message.d.ts +6 -4
  34. package/types/devvit/ui/effects/web_view/v1alpha/post_message.d.ts.map +1 -1
  35. package/types/devvit/ui/effects/web_view/v1alpha/post_message.js +15 -1
@@ -21,6 +21,7 @@ import { GetPaymentsVerificationStatusRequest, GetPaymentsVerificationStatusResp
21
21
  import { AppPRCreateRequest, AppPRUpdateRequest, AppPRGetRequest, FullPublishRequestInfo, AppPRFindManyRequest, MultiplePublishRequestInfos, } from './app_publish_request/app_publish_request.js';
22
22
  import { AppPRSetReviewDecisionRequest } from './app_publish_request/review/app_publish_request_review.js';
23
23
  import { AppPRAddNoteRequest, AppPRUpdateNoteRequest, } from './app_publish_request/note/app_publish_request_note.js';
24
+ import { DeveloperAccountRegisterUserRequest, DeveloperAccountInfo, GetUserAccountInfoResponse, } from './developer_account/developer_account.js';
24
25
  export var AppMethod;
25
26
  (function (AppMethod) {
26
27
  AppMethod["Create"] = "Create";
@@ -5253,3 +5254,157 @@ async function handleDevPortalAppPublishRequestRemoveNoteProtobuf(ctx, service,
5253
5254
  }
5254
5255
  return Buffer.from(Empty.encode(response).finish());
5255
5256
  }
5257
+ export var DeveloperAccountMethod;
5258
+ (function (DeveloperAccountMethod) {
5259
+ DeveloperAccountMethod["RegisterUser"] = "RegisterUser";
5260
+ DeveloperAccountMethod["GetUserAccountInfoIfExists"] = "GetUserAccountInfoIfExists";
5261
+ })(DeveloperAccountMethod || (DeveloperAccountMethod = {}));
5262
+ export const DeveloperAccountMethodList = [
5263
+ DeveloperAccountMethod.RegisterUser,
5264
+ DeveloperAccountMethod.GetUserAccountInfoIfExists,
5265
+ ];
5266
+ export function createDeveloperAccountServer(service) {
5267
+ return new TwirpServer({
5268
+ service,
5269
+ packageName: 'devvit.dev_portal',
5270
+ serviceName: 'DeveloperAccount',
5271
+ methodList: DeveloperAccountMethodList,
5272
+ matchRoute: matchDeveloperAccountRoute,
5273
+ });
5274
+ }
5275
+ function matchDeveloperAccountRoute(method, events) {
5276
+ switch (method) {
5277
+ case 'RegisterUser':
5278
+ return async (ctx, service, data, interceptors) => {
5279
+ ctx = { ...ctx, methodName: 'RegisterUser' };
5280
+ await events.onMatch(ctx);
5281
+ return handleDeveloperAccountRegisterUserRequest(ctx, service, data, interceptors);
5282
+ };
5283
+ case 'GetUserAccountInfoIfExists':
5284
+ return async (ctx, service, data, interceptors) => {
5285
+ ctx = { ...ctx, methodName: 'GetUserAccountInfoIfExists' };
5286
+ await events.onMatch(ctx);
5287
+ return handleDeveloperAccountGetUserAccountInfoIfExistsRequest(ctx, service, data, interceptors);
5288
+ };
5289
+ default:
5290
+ events.onNotFound();
5291
+ const msg = `no handler found`;
5292
+ throw new TwirpError(TwirpErrorCode.BadRoute, msg);
5293
+ }
5294
+ }
5295
+ function handleDeveloperAccountRegisterUserRequest(ctx, service, data, interceptors) {
5296
+ switch (ctx.contentType) {
5297
+ case TwirpContentType.JSON:
5298
+ return handleDeveloperAccountRegisterUserJSON(ctx, service, data, interceptors);
5299
+ case TwirpContentType.Protobuf:
5300
+ return handleDeveloperAccountRegisterUserProtobuf(ctx, service, data, interceptors);
5301
+ default:
5302
+ const msg = 'unexpected Content-Type';
5303
+ throw new TwirpError(TwirpErrorCode.BadRoute, msg);
5304
+ }
5305
+ }
5306
+ function handleDeveloperAccountGetUserAccountInfoIfExistsRequest(ctx, service, data, interceptors) {
5307
+ switch (ctx.contentType) {
5308
+ case TwirpContentType.JSON:
5309
+ return handleDeveloperAccountGetUserAccountInfoIfExistsJSON(ctx, service, data, interceptors);
5310
+ case TwirpContentType.Protobuf:
5311
+ return handleDeveloperAccountGetUserAccountInfoIfExistsProtobuf(ctx, service, data, interceptors);
5312
+ default:
5313
+ const msg = 'unexpected Content-Type';
5314
+ throw new TwirpError(TwirpErrorCode.BadRoute, msg);
5315
+ }
5316
+ }
5317
+ async function handleDeveloperAccountRegisterUserJSON(ctx, service, data, interceptors) {
5318
+ let request;
5319
+ let response;
5320
+ try {
5321
+ const body = JSON.parse(data.toString() || '{}');
5322
+ request = DeveloperAccountRegisterUserRequest.fromJSON(body);
5323
+ }
5324
+ catch (e) {
5325
+ if (e instanceof Error) {
5326
+ const msg = 'the json request could not be decoded';
5327
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
5328
+ }
5329
+ }
5330
+ if (interceptors && interceptors.length > 0) {
5331
+ const interceptor = chainInterceptors(...interceptors);
5332
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
5333
+ return service.RegisterUser(ctx, inputReq);
5334
+ });
5335
+ }
5336
+ else {
5337
+ response = await service.RegisterUser(ctx, request);
5338
+ }
5339
+ return JSON.stringify(DeveloperAccountInfo.toJSON(response));
5340
+ }
5341
+ async function handleDeveloperAccountGetUserAccountInfoIfExistsJSON(ctx, service, data, interceptors) {
5342
+ let request;
5343
+ let response;
5344
+ try {
5345
+ const body = JSON.parse(data.toString() || '{}');
5346
+ request = Empty.fromJSON(body);
5347
+ }
5348
+ catch (e) {
5349
+ if (e instanceof Error) {
5350
+ const msg = 'the json request could not be decoded';
5351
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
5352
+ }
5353
+ }
5354
+ if (interceptors && interceptors.length > 0) {
5355
+ const interceptor = chainInterceptors(...interceptors);
5356
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
5357
+ return service.GetUserAccountInfoIfExists(ctx, inputReq);
5358
+ });
5359
+ }
5360
+ else {
5361
+ response = await service.GetUserAccountInfoIfExists(ctx, request);
5362
+ }
5363
+ return JSON.stringify(GetUserAccountInfoResponse.toJSON(response));
5364
+ }
5365
+ async function handleDeveloperAccountRegisterUserProtobuf(ctx, service, data, interceptors) {
5366
+ let request;
5367
+ let response;
5368
+ try {
5369
+ request = DeveloperAccountRegisterUserRequest.decode(data);
5370
+ }
5371
+ catch (e) {
5372
+ if (e instanceof Error) {
5373
+ const msg = 'the protobuf request could not be decoded';
5374
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
5375
+ }
5376
+ }
5377
+ if (interceptors && interceptors.length > 0) {
5378
+ const interceptor = chainInterceptors(...interceptors);
5379
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
5380
+ return service.RegisterUser(ctx, inputReq);
5381
+ });
5382
+ }
5383
+ else {
5384
+ response = await service.RegisterUser(ctx, request);
5385
+ }
5386
+ return Buffer.from(DeveloperAccountInfo.encode(response).finish());
5387
+ }
5388
+ async function handleDeveloperAccountGetUserAccountInfoIfExistsProtobuf(ctx, service, data, interceptors) {
5389
+ let request;
5390
+ let response;
5391
+ try {
5392
+ request = Empty.decode(data);
5393
+ }
5394
+ catch (e) {
5395
+ if (e instanceof Error) {
5396
+ const msg = 'the protobuf request could not be decoded';
5397
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
5398
+ }
5399
+ }
5400
+ if (interceptors && interceptors.length > 0) {
5401
+ const interceptor = chainInterceptors(...interceptors);
5402
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
5403
+ return service.GetUserAccountInfoIfExists(ctx, inputReq);
5404
+ });
5405
+ }
5406
+ else {
5407
+ response = await service.GetUserAccountInfoIfExists(ctx, request);
5408
+ }
5409
+ return Buffer.from(GetUserAccountInfoResponse.encode(response).finish());
5410
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * #developer_account.ts
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import _m0 from "protobufjs/minimal.js";
7
+ export interface DeveloperAccountRegisterUserRequest {
8
+ /** Thing ID (T2 ID with prefix. eg, t2_123abc.) */
9
+ userId: string;
10
+ /** Username */
11
+ userName: string;
12
+ doesConsentToEmail: boolean;
13
+ }
14
+ export interface GetUserAccountInfoResponse {
15
+ /** The version of the developer terms & conditions accepted by the user upon Developer Account creation (ie, 2) */
16
+ acceptedTermsVersion: number;
17
+ /** The current version of the developer terms & conditions */
18
+ currentTermsVersion: number;
19
+ hasVerifiedEmail: boolean;
20
+ /** User selected preferences for email communication from the Developer Platform */
21
+ doesConsentToEmail: boolean;
22
+ /** Thing ID (T2 ID with prefix. eg, t2_123abc.), optional because user could be logged out */
23
+ userId?: string | undefined;
24
+ }
25
+ export interface DeveloperAccountInfo {
26
+ /** UUID of the Developer Account, assigned in database */
27
+ id: string;
28
+ /** Thing I (T2 ID with prefix. eg, t2_123abc.), optional because user could be logged out */
29
+ userId: string;
30
+ /** User's reddit username (eg, "spez") */
31
+ userName: string;
32
+ createdAt?: Date | undefined;
33
+ /** The version of the developer terms & conditions accepted by the user upon Developer Account creation (ie, 2) */
34
+ acceptedTermsVersion: number;
35
+ /** Timestamp of when the user accepted the current developer terms & conditions */
36
+ acceptedTermsVersionAt?: Date | undefined;
37
+ /** Whether the user has verified the email address associated with their Reddit Account */
38
+ hasVerifiedEmail: boolean;
39
+ /** User selected preferences for email communication from the Developer Platform */
40
+ doesConsentToEmail: boolean;
41
+ }
42
+ export declare const DeveloperAccountRegisterUserRequest: {
43
+ $type: "devvit.dev_portal.developer_account.DeveloperAccountRegisterUserRequest";
44
+ encode(message: DeveloperAccountRegisterUserRequest, writer?: _m0.Writer): _m0.Writer;
45
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeveloperAccountRegisterUserRequest;
46
+ fromJSON(object: any): DeveloperAccountRegisterUserRequest;
47
+ toJSON(message: DeveloperAccountRegisterUserRequest): unknown;
48
+ create(base?: DeepPartial<DeveloperAccountRegisterUserRequest>): DeveloperAccountRegisterUserRequest;
49
+ fromPartial(object: DeepPartial<DeveloperAccountRegisterUserRequest>): DeveloperAccountRegisterUserRequest;
50
+ };
51
+ export declare const GetUserAccountInfoResponse: {
52
+ $type: "devvit.dev_portal.developer_account.GetUserAccountInfoResponse";
53
+ encode(message: GetUserAccountInfoResponse, writer?: _m0.Writer): _m0.Writer;
54
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetUserAccountInfoResponse;
55
+ fromJSON(object: any): GetUserAccountInfoResponse;
56
+ toJSON(message: GetUserAccountInfoResponse): unknown;
57
+ create(base?: DeepPartial<GetUserAccountInfoResponse>): GetUserAccountInfoResponse;
58
+ fromPartial(object: DeepPartial<GetUserAccountInfoResponse>): GetUserAccountInfoResponse;
59
+ };
60
+ export declare const DeveloperAccountInfo: {
61
+ $type: "devvit.dev_portal.developer_account.DeveloperAccountInfo";
62
+ encode(message: DeveloperAccountInfo, writer?: _m0.Writer): _m0.Writer;
63
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeveloperAccountInfo;
64
+ fromJSON(object: any): DeveloperAccountInfo;
65
+ toJSON(message: DeveloperAccountInfo): unknown;
66
+ create(base?: DeepPartial<DeveloperAccountInfo>): DeveloperAccountInfo;
67
+ fromPartial(object: DeepPartial<DeveloperAccountInfo>): DeveloperAccountInfo;
68
+ };
69
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
70
+ 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 {} ? {
71
+ [K in keyof T]?: DeepPartial<T[K]>;
72
+ } : Partial<T>;
73
+ export {};
74
+ //# sourceMappingURL=developer_account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developer_account.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/dev_portal/developer_account/developer_account.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,MAAM,WAAW,mCAAmC;IAClD,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA0B;IACzC,mHAAmH;IACnH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oFAAoF;IACpF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EACN,IAAI,GACJ,SAAS,CAAC;IACd,mHAAmH;IACnH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mFAAmF;IACnF,sBAAsB,CAAC,EACnB,IAAI,GACJ,SAAS,CAAC;IACd,2FAA2F;IAC3F,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oFAAoF;IACpF,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAMD,eAAO,MAAM,mCAAmC;;oBAG9B,mCAAmC,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAa5F,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,mCAAmC;qBAqC3E,GAAG,GAAG,mCAAmC;oBAQ1C,mCAAmC,GAAG,OAAO;kBAc/C,YAAY,mCAAmC,CAAC,GAAG,mCAAmC;wBAGhF,YAAY,mCAAmC,CAAC,GAAG,mCAAmC;CAO3G,CAAC;AAcF,eAAO,MAAM,0BAA0B;;oBAGrB,0BAA0B,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAmBnF,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,0BAA0B;qBAmDlE,GAAG,GAAG,0BAA0B;oBAUjC,0BAA0B,GAAG,OAAO;kBAoBtC,YAAY,0BAA0B,CAAC,GAAG,0BAA0B;wBAG9D,YAAY,0BAA0B,CAAC,GAAG,0BAA0B;CASzF,CAAC;AAiBF,eAAO,MAAM,oBAAoB;;oBAGf,oBAAoB,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBA4B7E,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,oBAAoB;qBAwE5D,GAAG,GAAG,oBAAoB;oBAe3B,oBAAoB,GAAG,OAAO;kBA6BhC,YAAY,oBAAoB,CAAC,GAAG,oBAAoB;wBAGlD,YAAY,oBAAoB,CAAC,GAAG,oBAAoB;CAY7E,CAAC;AAIF,KAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GACvC,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,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"}
@@ -0,0 +1,394 @@
1
+ /**
2
+ * #developer_account.ts
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ /* eslint-disable */
7
+ import _m0 from "protobufjs/minimal.js";
8
+ import { Timestamp } from "../../../google/protobuf/timestamp.js";
9
+ import { messageTypeRegistry } from "../../../typeRegistry.js";
10
+ function createBaseDeveloperAccountRegisterUserRequest() {
11
+ return { userId: "", userName: "", doesConsentToEmail: false };
12
+ }
13
+ export const DeveloperAccountRegisterUserRequest = {
14
+ $type: "devvit.dev_portal.developer_account.DeveloperAccountRegisterUserRequest",
15
+ encode(message, writer = _m0.Writer.create()) {
16
+ if (message.userId !== "") {
17
+ writer.uint32(10).string(message.userId);
18
+ }
19
+ if (message.userName !== "") {
20
+ writer.uint32(18).string(message.userName);
21
+ }
22
+ if (message.doesConsentToEmail !== false) {
23
+ writer.uint32(24).bool(message.doesConsentToEmail);
24
+ }
25
+ return writer;
26
+ },
27
+ decode(input, length) {
28
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
29
+ let end = length === undefined ? reader.len : reader.pos + length;
30
+ const message = createBaseDeveloperAccountRegisterUserRequest();
31
+ while (reader.pos < end) {
32
+ const tag = reader.uint32();
33
+ switch (tag >>> 3) {
34
+ case 1:
35
+ if (tag !== 10) {
36
+ break;
37
+ }
38
+ message.userId = reader.string();
39
+ continue;
40
+ case 2:
41
+ if (tag !== 18) {
42
+ break;
43
+ }
44
+ message.userName = reader.string();
45
+ continue;
46
+ case 3:
47
+ if (tag !== 24) {
48
+ break;
49
+ }
50
+ message.doesConsentToEmail = reader.bool();
51
+ continue;
52
+ }
53
+ if ((tag & 7) === 4 || tag === 0) {
54
+ break;
55
+ }
56
+ reader.skipType(tag & 7);
57
+ }
58
+ return message;
59
+ },
60
+ fromJSON(object) {
61
+ return {
62
+ userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
63
+ userName: isSet(object.userName) ? globalThis.String(object.userName) : "",
64
+ doesConsentToEmail: isSet(object.doesConsentToEmail) ? globalThis.Boolean(object.doesConsentToEmail) : false,
65
+ };
66
+ },
67
+ toJSON(message) {
68
+ const obj = {};
69
+ if (message.userId !== "") {
70
+ obj.userId = message.userId;
71
+ }
72
+ if (message.userName !== "") {
73
+ obj.userName = message.userName;
74
+ }
75
+ if (message.doesConsentToEmail !== false) {
76
+ obj.doesConsentToEmail = message.doesConsentToEmail;
77
+ }
78
+ return obj;
79
+ },
80
+ create(base) {
81
+ return DeveloperAccountRegisterUserRequest.fromPartial(base ?? {});
82
+ },
83
+ fromPartial(object) {
84
+ const message = createBaseDeveloperAccountRegisterUserRequest();
85
+ message.userId = object.userId ?? "";
86
+ message.userName = object.userName ?? "";
87
+ message.doesConsentToEmail = object.doesConsentToEmail ?? false;
88
+ return message;
89
+ },
90
+ };
91
+ messageTypeRegistry.set(DeveloperAccountRegisterUserRequest.$type, DeveloperAccountRegisterUserRequest);
92
+ function createBaseGetUserAccountInfoResponse() {
93
+ return {
94
+ acceptedTermsVersion: 0,
95
+ currentTermsVersion: 0,
96
+ hasVerifiedEmail: false,
97
+ doesConsentToEmail: false,
98
+ userId: undefined,
99
+ };
100
+ }
101
+ export const GetUserAccountInfoResponse = {
102
+ $type: "devvit.dev_portal.developer_account.GetUserAccountInfoResponse",
103
+ encode(message, writer = _m0.Writer.create()) {
104
+ if (message.acceptedTermsVersion !== 0) {
105
+ writer.uint32(8).int32(message.acceptedTermsVersion);
106
+ }
107
+ if (message.currentTermsVersion !== 0) {
108
+ writer.uint32(16).int32(message.currentTermsVersion);
109
+ }
110
+ if (message.hasVerifiedEmail !== false) {
111
+ writer.uint32(24).bool(message.hasVerifiedEmail);
112
+ }
113
+ if (message.doesConsentToEmail !== false) {
114
+ writer.uint32(32).bool(message.doesConsentToEmail);
115
+ }
116
+ if (message.userId !== undefined) {
117
+ writer.uint32(42).string(message.userId);
118
+ }
119
+ return writer;
120
+ },
121
+ decode(input, length) {
122
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
123
+ let end = length === undefined ? reader.len : reader.pos + length;
124
+ const message = createBaseGetUserAccountInfoResponse();
125
+ while (reader.pos < end) {
126
+ const tag = reader.uint32();
127
+ switch (tag >>> 3) {
128
+ case 1:
129
+ if (tag !== 8) {
130
+ break;
131
+ }
132
+ message.acceptedTermsVersion = reader.int32();
133
+ continue;
134
+ case 2:
135
+ if (tag !== 16) {
136
+ break;
137
+ }
138
+ message.currentTermsVersion = reader.int32();
139
+ continue;
140
+ case 3:
141
+ if (tag !== 24) {
142
+ break;
143
+ }
144
+ message.hasVerifiedEmail = reader.bool();
145
+ continue;
146
+ case 4:
147
+ if (tag !== 32) {
148
+ break;
149
+ }
150
+ message.doesConsentToEmail = reader.bool();
151
+ continue;
152
+ case 5:
153
+ if (tag !== 42) {
154
+ break;
155
+ }
156
+ message.userId = reader.string();
157
+ continue;
158
+ }
159
+ if ((tag & 7) === 4 || tag === 0) {
160
+ break;
161
+ }
162
+ reader.skipType(tag & 7);
163
+ }
164
+ return message;
165
+ },
166
+ fromJSON(object) {
167
+ return {
168
+ acceptedTermsVersion: isSet(object.acceptedTermsVersion) ? globalThis.Number(object.acceptedTermsVersion) : 0,
169
+ currentTermsVersion: isSet(object.currentTermsVersion) ? globalThis.Number(object.currentTermsVersion) : 0,
170
+ hasVerifiedEmail: isSet(object.hasVerifiedEmail) ? globalThis.Boolean(object.hasVerifiedEmail) : false,
171
+ doesConsentToEmail: isSet(object.doesConsentToEmail) ? globalThis.Boolean(object.doesConsentToEmail) : false,
172
+ userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
173
+ };
174
+ },
175
+ toJSON(message) {
176
+ const obj = {};
177
+ if (message.acceptedTermsVersion !== 0) {
178
+ obj.acceptedTermsVersion = Math.round(message.acceptedTermsVersion);
179
+ }
180
+ if (message.currentTermsVersion !== 0) {
181
+ obj.currentTermsVersion = Math.round(message.currentTermsVersion);
182
+ }
183
+ if (message.hasVerifiedEmail !== false) {
184
+ obj.hasVerifiedEmail = message.hasVerifiedEmail;
185
+ }
186
+ if (message.doesConsentToEmail !== false) {
187
+ obj.doesConsentToEmail = message.doesConsentToEmail;
188
+ }
189
+ if (message.userId !== undefined) {
190
+ obj.userId = message.userId;
191
+ }
192
+ return obj;
193
+ },
194
+ create(base) {
195
+ return GetUserAccountInfoResponse.fromPartial(base ?? {});
196
+ },
197
+ fromPartial(object) {
198
+ const message = createBaseGetUserAccountInfoResponse();
199
+ message.acceptedTermsVersion = object.acceptedTermsVersion ?? 0;
200
+ message.currentTermsVersion = object.currentTermsVersion ?? 0;
201
+ message.hasVerifiedEmail = object.hasVerifiedEmail ?? false;
202
+ message.doesConsentToEmail = object.doesConsentToEmail ?? false;
203
+ message.userId = object.userId ?? undefined;
204
+ return message;
205
+ },
206
+ };
207
+ messageTypeRegistry.set(GetUserAccountInfoResponse.$type, GetUserAccountInfoResponse);
208
+ function createBaseDeveloperAccountInfo() {
209
+ return {
210
+ id: "",
211
+ userId: "",
212
+ userName: "",
213
+ createdAt: undefined,
214
+ acceptedTermsVersion: 0,
215
+ acceptedTermsVersionAt: undefined,
216
+ hasVerifiedEmail: false,
217
+ doesConsentToEmail: false,
218
+ };
219
+ }
220
+ export const DeveloperAccountInfo = {
221
+ $type: "devvit.dev_portal.developer_account.DeveloperAccountInfo",
222
+ encode(message, writer = _m0.Writer.create()) {
223
+ if (message.id !== "") {
224
+ writer.uint32(10).string(message.id);
225
+ }
226
+ if (message.userId !== "") {
227
+ writer.uint32(18).string(message.userId);
228
+ }
229
+ if (message.userName !== "") {
230
+ writer.uint32(26).string(message.userName);
231
+ }
232
+ if (message.createdAt !== undefined) {
233
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(34).fork()).ldelim();
234
+ }
235
+ if (message.acceptedTermsVersion !== 0) {
236
+ writer.uint32(40).int32(message.acceptedTermsVersion);
237
+ }
238
+ if (message.acceptedTermsVersionAt !== undefined) {
239
+ Timestamp.encode(toTimestamp(message.acceptedTermsVersionAt), writer.uint32(50).fork()).ldelim();
240
+ }
241
+ if (message.hasVerifiedEmail !== false) {
242
+ writer.uint32(56).bool(message.hasVerifiedEmail);
243
+ }
244
+ if (message.doesConsentToEmail !== false) {
245
+ writer.uint32(64).bool(message.doesConsentToEmail);
246
+ }
247
+ return writer;
248
+ },
249
+ decode(input, length) {
250
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
251
+ let end = length === undefined ? reader.len : reader.pos + length;
252
+ const message = createBaseDeveloperAccountInfo();
253
+ while (reader.pos < end) {
254
+ const tag = reader.uint32();
255
+ switch (tag >>> 3) {
256
+ case 1:
257
+ if (tag !== 10) {
258
+ break;
259
+ }
260
+ message.id = reader.string();
261
+ continue;
262
+ case 2:
263
+ if (tag !== 18) {
264
+ break;
265
+ }
266
+ message.userId = reader.string();
267
+ continue;
268
+ case 3:
269
+ if (tag !== 26) {
270
+ break;
271
+ }
272
+ message.userName = reader.string();
273
+ continue;
274
+ case 4:
275
+ if (tag !== 34) {
276
+ break;
277
+ }
278
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
279
+ continue;
280
+ case 5:
281
+ if (tag !== 40) {
282
+ break;
283
+ }
284
+ message.acceptedTermsVersion = reader.int32();
285
+ continue;
286
+ case 6:
287
+ if (tag !== 50) {
288
+ break;
289
+ }
290
+ message.acceptedTermsVersionAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
291
+ continue;
292
+ case 7:
293
+ if (tag !== 56) {
294
+ break;
295
+ }
296
+ message.hasVerifiedEmail = reader.bool();
297
+ continue;
298
+ case 8:
299
+ if (tag !== 64) {
300
+ break;
301
+ }
302
+ message.doesConsentToEmail = reader.bool();
303
+ continue;
304
+ }
305
+ if ((tag & 7) === 4 || tag === 0) {
306
+ break;
307
+ }
308
+ reader.skipType(tag & 7);
309
+ }
310
+ return message;
311
+ },
312
+ fromJSON(object) {
313
+ return {
314
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
315
+ userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
316
+ userName: isSet(object.userName) ? globalThis.String(object.userName) : "",
317
+ createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
318
+ acceptedTermsVersion: isSet(object.acceptedTermsVersion) ? globalThis.Number(object.acceptedTermsVersion) : 0,
319
+ acceptedTermsVersionAt: isSet(object.acceptedTermsVersionAt)
320
+ ? fromJsonTimestamp(object.acceptedTermsVersionAt)
321
+ : undefined,
322
+ hasVerifiedEmail: isSet(object.hasVerifiedEmail) ? globalThis.Boolean(object.hasVerifiedEmail) : false,
323
+ doesConsentToEmail: isSet(object.doesConsentToEmail) ? globalThis.Boolean(object.doesConsentToEmail) : false,
324
+ };
325
+ },
326
+ toJSON(message) {
327
+ const obj = {};
328
+ if (message.id !== "") {
329
+ obj.id = message.id;
330
+ }
331
+ if (message.userId !== "") {
332
+ obj.userId = message.userId;
333
+ }
334
+ if (message.userName !== "") {
335
+ obj.userName = message.userName;
336
+ }
337
+ if (message.createdAt !== undefined) {
338
+ obj.createdAt = message.createdAt.toISOString();
339
+ }
340
+ if (message.acceptedTermsVersion !== 0) {
341
+ obj.acceptedTermsVersion = Math.round(message.acceptedTermsVersion);
342
+ }
343
+ if (message.acceptedTermsVersionAt !== undefined) {
344
+ obj.acceptedTermsVersionAt = message.acceptedTermsVersionAt.toISOString();
345
+ }
346
+ if (message.hasVerifiedEmail !== false) {
347
+ obj.hasVerifiedEmail = message.hasVerifiedEmail;
348
+ }
349
+ if (message.doesConsentToEmail !== false) {
350
+ obj.doesConsentToEmail = message.doesConsentToEmail;
351
+ }
352
+ return obj;
353
+ },
354
+ create(base) {
355
+ return DeveloperAccountInfo.fromPartial(base ?? {});
356
+ },
357
+ fromPartial(object) {
358
+ const message = createBaseDeveloperAccountInfo();
359
+ message.id = object.id ?? "";
360
+ message.userId = object.userId ?? "";
361
+ message.userName = object.userName ?? "";
362
+ message.createdAt = object.createdAt ?? undefined;
363
+ message.acceptedTermsVersion = object.acceptedTermsVersion ?? 0;
364
+ message.acceptedTermsVersionAt = object.acceptedTermsVersionAt ?? undefined;
365
+ message.hasVerifiedEmail = object.hasVerifiedEmail ?? false;
366
+ message.doesConsentToEmail = object.doesConsentToEmail ?? false;
367
+ return message;
368
+ },
369
+ };
370
+ messageTypeRegistry.set(DeveloperAccountInfo.$type, DeveloperAccountInfo);
371
+ function toTimestamp(date) {
372
+ const seconds = Math.trunc(date.getTime() / 1000);
373
+ const nanos = (date.getTime() % 1000) * 1000000;
374
+ return { seconds, nanos };
375
+ }
376
+ function fromTimestamp(t) {
377
+ let millis = (t.seconds || 0) * 1000;
378
+ millis += (t.nanos || 0) / 1000000;
379
+ return new globalThis.Date(millis);
380
+ }
381
+ function fromJsonTimestamp(o) {
382
+ if (o instanceof globalThis.Date) {
383
+ return o;
384
+ }
385
+ else if (typeof o === "string") {
386
+ return new globalThis.Date(o);
387
+ }
388
+ else {
389
+ return fromTimestamp(Timestamp.fromJSON(o));
390
+ }
391
+ }
392
+ function isSet(value) {
393
+ return value !== null && value !== undefined;
394
+ }
@@ -10,6 +10,7 @@ import { User } from "../../../reddit/user.js";
10
10
  export declare enum RunAs {
11
11
  APP = 0,
12
12
  USER = 1,
13
+ UNSPECIFIED = 2,
13
14
  UNRECOGNIZED = -1
14
15
  }
15
16
  export declare function runAsFromJSON(object: any): RunAs;