@devvit/protos 0.11.5-next-2024-12-09-1c29dd3cd.0 → 0.11.5-next-2024-12-09-8401a61d8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ import { AddUsersToOrgRequest, AddUsersToOrgResponse, GetUsersByOrgIdRequest, Ge
17
17
  import { Value } from '../../google/protobuf/struct.js';
18
18
  import { GetInstallationSettingsFormRequest, GetInstallationSettingsFormResponse, ValidateInstallationSettingsFormRequest, ValidateInstallationSettingsFormResponse, GetInstallationSettingsRequest, GetInstallationSettingsResponse, UpdateInstallationSettingsRequest, UpdateInstallationSettingsResponse, } from './installation_settings/installation_settings.js';
19
19
  import { GetAppSettingsFormRequest, GetAppSettingsFormResponse, ValidateAppSettingsFormRequest, ValidateAppSettingsFormResponse, GetAppSettingsRequest, GetAppSettingsResponse, UpdateAppSettingsRequest, UpdateAppSettingsResponse, } from './app_settings/app_settings.js';
20
+ import { GetPaymentsVerificationStatusRequest, GetPaymentsVerificationStatusResponse, } from './payments/payments_verification.js';
20
21
  import { AppPRCreateRequest, AppPRUpdateRequest, AppPRGetRequest, FullPublishRequestInfo, AppPRFindManyRequest, MultiplePublishRequestInfos, } from './app_publish_request/app_publish_request.js';
21
22
  import { AppPRSetReviewDecisionRequest } from './app_publish_request/review/app_publish_request_review.js';
22
23
  import { AppPRAddNoteRequest, AppPRUpdateNoteRequest, } from './app_publish_request/note/app_publish_request_note.js';
@@ -4548,6 +4549,94 @@ async function handleDevPortalAppSettingsUpdateSettingsProtobuf(ctx, service, da
4548
4549
  }
4549
4550
  return Buffer.from(UpdateAppSettingsResponse.encode(response).finish());
4550
4551
  }
4552
+ export var DevPortalDeveloperSettingsMethod;
4553
+ (function (DevPortalDeveloperSettingsMethod) {
4554
+ DevPortalDeveloperSettingsMethod["GetPaymentsVerificationStatus"] = "GetPaymentsVerificationStatus";
4555
+ })(DevPortalDeveloperSettingsMethod || (DevPortalDeveloperSettingsMethod = {}));
4556
+ export const DevPortalDeveloperSettingsMethodList = [
4557
+ DevPortalDeveloperSettingsMethod.GetPaymentsVerificationStatus,
4558
+ ];
4559
+ export function createDevPortalDeveloperSettingsServer(service) {
4560
+ return new TwirpServer({
4561
+ service,
4562
+ packageName: 'devvit.dev_portal',
4563
+ serviceName: 'DevPortalDeveloperSettings',
4564
+ methodList: DevPortalDeveloperSettingsMethodList,
4565
+ matchRoute: matchDevPortalDeveloperSettingsRoute,
4566
+ });
4567
+ }
4568
+ function matchDevPortalDeveloperSettingsRoute(method, events) {
4569
+ switch (method) {
4570
+ case 'GetPaymentsVerificationStatus':
4571
+ return async (ctx, service, data, interceptors) => {
4572
+ ctx = { ...ctx, methodName: 'GetPaymentsVerificationStatus' };
4573
+ await events.onMatch(ctx);
4574
+ return handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusRequest(ctx, service, data, interceptors);
4575
+ };
4576
+ default:
4577
+ events.onNotFound();
4578
+ const msg = `no handler found`;
4579
+ throw new TwirpError(TwirpErrorCode.BadRoute, msg);
4580
+ }
4581
+ }
4582
+ function handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusRequest(ctx, service, data, interceptors) {
4583
+ switch (ctx.contentType) {
4584
+ case TwirpContentType.JSON:
4585
+ return handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusJSON(ctx, service, data, interceptors);
4586
+ case TwirpContentType.Protobuf:
4587
+ return handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusProtobuf(ctx, service, data, interceptors);
4588
+ default:
4589
+ const msg = 'unexpected Content-Type';
4590
+ throw new TwirpError(TwirpErrorCode.BadRoute, msg);
4591
+ }
4592
+ }
4593
+ async function handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusJSON(ctx, service, data, interceptors) {
4594
+ let request;
4595
+ let response;
4596
+ try {
4597
+ const body = JSON.parse(data.toString() || '{}');
4598
+ request = GetPaymentsVerificationStatusRequest.fromJSON(body);
4599
+ }
4600
+ catch (e) {
4601
+ if (e instanceof Error) {
4602
+ const msg = 'the json request could not be decoded';
4603
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
4604
+ }
4605
+ }
4606
+ if (interceptors && interceptors.length > 0) {
4607
+ const interceptor = chainInterceptors(...interceptors);
4608
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
4609
+ return service.GetPaymentsVerificationStatus(ctx, inputReq);
4610
+ });
4611
+ }
4612
+ else {
4613
+ response = await service.GetPaymentsVerificationStatus(ctx, request);
4614
+ }
4615
+ return JSON.stringify(GetPaymentsVerificationStatusResponse.toJSON(response));
4616
+ }
4617
+ async function handleDevPortalDeveloperSettingsGetPaymentsVerificationStatusProtobuf(ctx, service, data, interceptors) {
4618
+ let request;
4619
+ let response;
4620
+ try {
4621
+ request = GetPaymentsVerificationStatusRequest.decode(data);
4622
+ }
4623
+ catch (e) {
4624
+ if (e instanceof Error) {
4625
+ const msg = 'the protobuf request could not be decoded';
4626
+ throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
4627
+ }
4628
+ }
4629
+ if (interceptors && interceptors.length > 0) {
4630
+ const interceptor = chainInterceptors(...interceptors);
4631
+ response = await interceptor(ctx, request, (ctx, inputReq) => {
4632
+ return service.GetPaymentsVerificationStatus(ctx, inputReq);
4633
+ });
4634
+ }
4635
+ else {
4636
+ response = await service.GetPaymentsVerificationStatus(ctx, request);
4637
+ }
4638
+ return Buffer.from(GetPaymentsVerificationStatusResponse.encode(response).finish());
4639
+ }
4551
4640
  export var DevPortalAppPublishRequestMethod;
4552
4641
  (function (DevPortalAppPublishRequestMethod) {
4553
4642
  DevPortalAppPublishRequestMethod["Submit"] = "Submit";
@@ -0,0 +1,59 @@
1
+ /**
2
+ * #payments_verification.ts
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import _m0 from "protobufjs/minimal.js";
7
+ /**
8
+ * The verification status of a devvit developer. This shows whether or not a user can receive payments
9
+ * and their state in the verification flow. See design doc here:
10
+ * https://docs.google.com/document/d/1HuAfNB_26jnNu7gGDHk-vafzgpnoNaFqHoumE2C40cA/edit?tab=t.0#bookmark=id.hm6xb18pqjvh
11
+ */
12
+ export declare enum PaymentsVerificationStatus {
13
+ UNKNOWN = 0,
14
+ /** VERIFICATION_NOT_STARTED - User has not begun the verification process and is permitted to. */
15
+ VERIFICATION_NOT_STARTED = 1,
16
+ /** VERIFICATION_PENDING - User has begun the verification process. */
17
+ VERIFICATION_PENDING = 2,
18
+ /**
19
+ * VERIFICATION_CAN_NOT_START - User is not eligible to receive payments. This may be because they're ineligible to apply for payments
20
+ * or because they applied and were rejected.
21
+ */
22
+ VERIFICATION_CAN_NOT_START = 3,
23
+ /** VERIFICATION_SUCCESS - Verification has been completed and the user is able to receive payments. */
24
+ VERIFICATION_SUCCESS = 4,
25
+ UNRECOGNIZED = -1
26
+ }
27
+ export declare function paymentsVerificationStatusFromJSON(object: any): PaymentsVerificationStatus;
28
+ export declare function paymentsVerificationStatusToJSON(object: PaymentsVerificationStatus): number;
29
+ /** Get verification status. */
30
+ export interface GetPaymentsVerificationStatusRequest {
31
+ }
32
+ /** Return verification response. */
33
+ export interface GetPaymentsVerificationStatusResponse {
34
+ status: PaymentsVerificationStatus;
35
+ }
36
+ export declare const GetPaymentsVerificationStatusRequest: {
37
+ $type: "devvit.dev_portal.payments.GetPaymentsVerificationStatusRequest";
38
+ encode(_: GetPaymentsVerificationStatusRequest, writer?: _m0.Writer): _m0.Writer;
39
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetPaymentsVerificationStatusRequest;
40
+ fromJSON(_: any): GetPaymentsVerificationStatusRequest;
41
+ toJSON(_: GetPaymentsVerificationStatusRequest): unknown;
42
+ create(base?: DeepPartial<GetPaymentsVerificationStatusRequest>): GetPaymentsVerificationStatusRequest;
43
+ fromPartial(_: DeepPartial<GetPaymentsVerificationStatusRequest>): GetPaymentsVerificationStatusRequest;
44
+ };
45
+ export declare const GetPaymentsVerificationStatusResponse: {
46
+ $type: "devvit.dev_portal.payments.GetPaymentsVerificationStatusResponse";
47
+ encode(message: GetPaymentsVerificationStatusResponse, writer?: _m0.Writer): _m0.Writer;
48
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetPaymentsVerificationStatusResponse;
49
+ fromJSON(object: any): GetPaymentsVerificationStatusResponse;
50
+ toJSON(message: GetPaymentsVerificationStatusResponse): unknown;
51
+ create(base?: DeepPartial<GetPaymentsVerificationStatusResponse>): GetPaymentsVerificationStatusResponse;
52
+ fromPartial(object: DeepPartial<GetPaymentsVerificationStatusResponse>): GetPaymentsVerificationStatusResponse;
53
+ };
54
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
55
+ 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 {} ? {
56
+ [K in keyof T]?: DeepPartial<T[K]>;
57
+ } : Partial<T>;
58
+ export {};
59
+ //# sourceMappingURL=payments_verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments_verification.d.ts","sourceRoot":"","sources":["../../../../../src/types/devvit/dev_portal/payments/payments_verification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAGxC;;;;GAIG;AACH,oBAAY,0BAA0B;IACpC,OAAO,IAAI;IACX,kGAAkG;IAClG,wBAAwB,IAAI;IAC5B,sEAAsE;IACtE,oBAAoB,IAAI;IACxB;;;OAGG;IACH,0BAA0B,IAAI;IAC9B,uGAAuG;IACvG,oBAAoB,IAAI;IACxB,YAAY,KAAK;CAClB;AAED,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,GAAG,GAAG,0BAA0B,CAsB1F;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,0BAA0B,GAAG,MAAM,CAgB3F;AAED,+BAA+B;AAC/B,MAAM,WAAW,oCAAoC;CACpD;AAED,oCAAoC;AACpC,MAAM,WAAW,qCAAqC;IACpD,MAAM,EAAE,0BAA0B,CAAC;CACpC;AAMD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/* eslint-disable */
7
+ import _m0 from "protobufjs/minimal.js";
8
+ import { messageTypeRegistry } from "../../../typeRegistry.js";
9
+ /**
10
+ * The verification status of a devvit developer. This shows whether or not a user can receive payments
11
+ * and their state in the verification flow. See design doc here:
12
+ * https://docs.google.com/document/d/1HuAfNB_26jnNu7gGDHk-vafzgpnoNaFqHoumE2C40cA/edit?tab=t.0#bookmark=id.hm6xb18pqjvh
13
+ */
14
+ export var PaymentsVerificationStatus;
15
+ (function (PaymentsVerificationStatus) {
16
+ PaymentsVerificationStatus[PaymentsVerificationStatus["UNKNOWN"] = 0] = "UNKNOWN";
17
+ /** VERIFICATION_NOT_STARTED - User has not begun the verification process and is permitted to. */
18
+ PaymentsVerificationStatus[PaymentsVerificationStatus["VERIFICATION_NOT_STARTED"] = 1] = "VERIFICATION_NOT_STARTED";
19
+ /** VERIFICATION_PENDING - User has begun the verification process. */
20
+ PaymentsVerificationStatus[PaymentsVerificationStatus["VERIFICATION_PENDING"] = 2] = "VERIFICATION_PENDING";
21
+ /**
22
+ * VERIFICATION_CAN_NOT_START - User is not eligible to receive payments. This may be because they're ineligible to apply for payments
23
+ * or because they applied and were rejected.
24
+ */
25
+ PaymentsVerificationStatus[PaymentsVerificationStatus["VERIFICATION_CAN_NOT_START"] = 3] = "VERIFICATION_CAN_NOT_START";
26
+ /** VERIFICATION_SUCCESS - Verification has been completed and the user is able to receive payments. */
27
+ PaymentsVerificationStatus[PaymentsVerificationStatus["VERIFICATION_SUCCESS"] = 4] = "VERIFICATION_SUCCESS";
28
+ PaymentsVerificationStatus[PaymentsVerificationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(PaymentsVerificationStatus || (PaymentsVerificationStatus = {}));
30
+ export function paymentsVerificationStatusFromJSON(object) {
31
+ switch (object) {
32
+ case 0:
33
+ case "UNKNOWN":
34
+ return PaymentsVerificationStatus.UNKNOWN;
35
+ case 1:
36
+ case "VERIFICATION_NOT_STARTED":
37
+ return PaymentsVerificationStatus.VERIFICATION_NOT_STARTED;
38
+ case 2:
39
+ case "VERIFICATION_PENDING":
40
+ return PaymentsVerificationStatus.VERIFICATION_PENDING;
41
+ case 3:
42
+ case "VERIFICATION_CAN_NOT_START":
43
+ return PaymentsVerificationStatus.VERIFICATION_CAN_NOT_START;
44
+ case 4:
45
+ case "VERIFICATION_SUCCESS":
46
+ return PaymentsVerificationStatus.VERIFICATION_SUCCESS;
47
+ case -1:
48
+ case "UNRECOGNIZED":
49
+ default:
50
+ return PaymentsVerificationStatus.UNRECOGNIZED;
51
+ }
52
+ }
53
+ export function paymentsVerificationStatusToJSON(object) {
54
+ switch (object) {
55
+ case PaymentsVerificationStatus.UNKNOWN:
56
+ return 0;
57
+ case PaymentsVerificationStatus.VERIFICATION_NOT_STARTED:
58
+ return 1;
59
+ case PaymentsVerificationStatus.VERIFICATION_PENDING:
60
+ return 2;
61
+ case PaymentsVerificationStatus.VERIFICATION_CAN_NOT_START:
62
+ return 3;
63
+ case PaymentsVerificationStatus.VERIFICATION_SUCCESS:
64
+ return 4;
65
+ case PaymentsVerificationStatus.UNRECOGNIZED:
66
+ default:
67
+ return -1;
68
+ }
69
+ }
70
+ function createBaseGetPaymentsVerificationStatusRequest() {
71
+ return {};
72
+ }
73
+ export const GetPaymentsVerificationStatusRequest = {
74
+ $type: "devvit.dev_portal.payments.GetPaymentsVerificationStatusRequest",
75
+ encode(_, writer = _m0.Writer.create()) {
76
+ return writer;
77
+ },
78
+ decode(input, length) {
79
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
80
+ let end = length === undefined ? reader.len : reader.pos + length;
81
+ const message = createBaseGetPaymentsVerificationStatusRequest();
82
+ while (reader.pos < end) {
83
+ const tag = reader.uint32();
84
+ switch (tag >>> 3) {
85
+ }
86
+ if ((tag & 7) === 4 || tag === 0) {
87
+ break;
88
+ }
89
+ reader.skipType(tag & 7);
90
+ }
91
+ return message;
92
+ },
93
+ fromJSON(_) {
94
+ return {};
95
+ },
96
+ toJSON(_) {
97
+ const obj = {};
98
+ return obj;
99
+ },
100
+ create(base) {
101
+ return GetPaymentsVerificationStatusRequest.fromPartial(base ?? {});
102
+ },
103
+ fromPartial(_) {
104
+ const message = createBaseGetPaymentsVerificationStatusRequest();
105
+ return message;
106
+ },
107
+ };
108
+ messageTypeRegistry.set(GetPaymentsVerificationStatusRequest.$type, GetPaymentsVerificationStatusRequest);
109
+ function createBaseGetPaymentsVerificationStatusResponse() {
110
+ return { status: 0 };
111
+ }
112
+ export const GetPaymentsVerificationStatusResponse = {
113
+ $type: "devvit.dev_portal.payments.GetPaymentsVerificationStatusResponse",
114
+ encode(message, writer = _m0.Writer.create()) {
115
+ if (message.status !== 0) {
116
+ writer.uint32(8).int32(message.status);
117
+ }
118
+ return writer;
119
+ },
120
+ decode(input, length) {
121
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
122
+ let end = length === undefined ? reader.len : reader.pos + length;
123
+ const message = createBaseGetPaymentsVerificationStatusResponse();
124
+ while (reader.pos < end) {
125
+ const tag = reader.uint32();
126
+ switch (tag >>> 3) {
127
+ case 1:
128
+ if (tag !== 8) {
129
+ break;
130
+ }
131
+ message.status = reader.int32();
132
+ continue;
133
+ }
134
+ if ((tag & 7) === 4 || tag === 0) {
135
+ break;
136
+ }
137
+ reader.skipType(tag & 7);
138
+ }
139
+ return message;
140
+ },
141
+ fromJSON(object) {
142
+ return { status: isSet(object.status) ? paymentsVerificationStatusFromJSON(object.status) : 0 };
143
+ },
144
+ toJSON(message) {
145
+ const obj = {};
146
+ if (message.status !== 0) {
147
+ obj.status = paymentsVerificationStatusToJSON(message.status);
148
+ }
149
+ return obj;
150
+ },
151
+ create(base) {
152
+ return GetPaymentsVerificationStatusResponse.fromPartial(base ?? {});
153
+ },
154
+ fromPartial(object) {
155
+ const message = createBaseGetPaymentsVerificationStatusResponse();
156
+ message.status = object.status ?? 0;
157
+ return message;
158
+ },
159
+ };
160
+ messageTypeRegistry.set(GetPaymentsVerificationStatusResponse.$type, GetPaymentsVerificationStatusResponse);
161
+ function isSet(value) {
162
+ return value !== null && value !== undefined;
163
+ }