@devvit/protos 0.11.20-next-2025-07-23-16-35-06-4e9bd2820.0 → 0.11.20-next-2025-07-23-18-03-59-68cb855f3.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.
@@ -5,6 +5,41 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  import _m0 from "protobufjs/minimal.js";
8
+ /**
9
+ * Initialization data sent from the client (Shreddit, Android, iOS) to the
10
+ * web view.
11
+ */
12
+ export interface BridgeContext {
13
+ /**
14
+ * to-do: use webbit_token once it is a superset of DevvitPostData and a
15
+ * decoder is available.
16
+ *
17
+ * @deprecated
18
+ */
19
+ postData?: DevvitPostData | undefined;
20
+ shareParam?: ShareParam | undefined;
21
+ /**
22
+ * to-do: use webbit_token once it is a superset of WebViewContext.
23
+ *
24
+ * @deprecated
25
+ */
26
+ webViewContext?: WebViewContext | undefined;
27
+ /**
28
+ * Signed WebbitToken user JWT (header, payload, signature base64 strings
29
+ * separated by dots). Users shouldn't share their JWTs with others, but
30
+ * perfectly fine for a given user to see. Named WebbitToken to match GQL's
31
+ * definition. Eg:
32
+ * eyJhbGciOiJIUzI1NiIsImtpZCI6ImVlYzJjOWUzLWM0NTctNTM3Zi05NThmLTI5MDg3N2U4NjNlYyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkZXZ2aXQtZ2F0ZXdheS5yZWRkaXQuY29tIiwiYXVkIjpbIjhlMGUwZWI3LTc0NzgtNGVmMS1hNGZmLTk5NTlmMTkzZmNkMC0wLTAtOS13ZWJ2aWV3LmRldnZpdC5uZXQiXSwiZXhwIjoxNzUzMzcxODU2LCJuYmYiOjE3NTMyODU0NTYsImlhdCI6MTc1MzI4NTQ1NiwianRpIjoiYTA5NWMyOTktOWJkNS00MGUzLWEyYTEtYzhkYTBiMDc0ZjRhIiwiZGV2dml0LXBvc3QtaWQiOiJ0M18xbTdjcHZxIiwiZGV2dml0LXBvc3QtZGF0YSI6e30sImRldnZpdC11c2VyLWlkIjoidDJfazZsZGJqaDMiLCJkZXZ2aXQtaW5zdGFsbGF0aW9uIjoiOGUwZTBlYjctNzQ3OC00ZWYxLWE0ZmYtOTk1OWYxOTNmY2QwIn0.6M4NKCUsB4kWhZmslE909IL-hf2FAVMrkjB-peaHLHc
33
+ */
34
+ webbitToken: string;
35
+ /**
36
+ * Untrusted unknown debug user data passed in the case-insensitive
37
+ * `devvitdebug` query param of the hosting
38
+ * window (eg, `reddit.com?devvitdebug=...`).
39
+ */
40
+ devvitDebug: string;
41
+ }
42
+ /** @deprecated */
8
43
  export interface WebViewContext {
9
44
  /** Subreddit Thing ID (t5) */
10
45
  subredditId: string;
@@ -26,6 +61,49 @@ export interface DevvitPostData {
26
61
  [key: string]: any;
27
62
  } | undefined;
28
63
  }
64
+ /**
65
+ * App deep link. Passed in case-insensitive `devvitshare` query param of the
66
+ * hosting window (eg, `reddit.com?devvitshare=...`) as user data.
67
+ *
68
+ * url.searchParams.set(
69
+ * JSON.stringify({params: {foo: 'bar'}, path: '/a/b/c/index.html', hash: '#abc'} satisfies ShareParam) // Encodes.
70
+ * )
71
+ * const shareParam: ShareParam | undefined = JSON.parse(
72
+ * url.searchParams.get('devvitshare') || '{}' // Decodes.
73
+ * ) ?? undefined
74
+ * ...Verify user data...
75
+ *
76
+ * Links are always assumed to use PDP.
77
+ */
78
+ export interface ShareParam {
79
+ /**
80
+ * Everything after and including the first /. Aligns to
81
+ * https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname.
82
+ */
83
+ path: string;
84
+ /** URL query parameters (key-value). */
85
+ params: {
86
+ [key: string]: string;
87
+ };
88
+ /**
89
+ * Everything after and including the first #. Aligns to
90
+ * https://developer.mozilla.org/en-US/docs/Web/API/URL/hash.
91
+ */
92
+ hash: string;
93
+ }
94
+ export interface ShareParam_ParamsEntry {
95
+ key: string;
96
+ value: string;
97
+ }
98
+ export declare const BridgeContext: {
99
+ $type: "devvit.ui.effects.web_view.v1alpha.BridgeContext";
100
+ encode(message: BridgeContext, writer?: _m0.Writer): _m0.Writer;
101
+ decode(input: _m0.Reader | Uint8Array, length?: number): BridgeContext;
102
+ fromJSON(object: any): BridgeContext;
103
+ toJSON(message: BridgeContext): unknown;
104
+ create(base?: DeepPartial<BridgeContext>): BridgeContext;
105
+ fromPartial(object: DeepPartial<BridgeContext>): BridgeContext;
106
+ };
29
107
  export declare const WebViewContext: {
30
108
  $type: "devvit.ui.effects.web_view.v1alpha.WebViewContext";
31
109
  encode(message: WebViewContext, writer?: _m0.Writer): _m0.Writer;
@@ -44,6 +122,24 @@ export declare const DevvitPostData: {
44
122
  create(base?: DeepPartial<DevvitPostData>): DevvitPostData;
45
123
  fromPartial(object: DeepPartial<DevvitPostData>): DevvitPostData;
46
124
  };
125
+ export declare const ShareParam: {
126
+ $type: "devvit.ui.effects.web_view.v1alpha.ShareParam";
127
+ encode(message: ShareParam, writer?: _m0.Writer): _m0.Writer;
128
+ decode(input: _m0.Reader | Uint8Array, length?: number): ShareParam;
129
+ fromJSON(object: any): ShareParam;
130
+ toJSON(message: ShareParam): unknown;
131
+ create(base?: DeepPartial<ShareParam>): ShareParam;
132
+ fromPartial(object: DeepPartial<ShareParam>): ShareParam;
133
+ };
134
+ export declare const ShareParam_ParamsEntry: {
135
+ $type: "devvit.ui.effects.web_view.v1alpha.ShareParam.ParamsEntry";
136
+ encode(message: ShareParam_ParamsEntry, writer?: _m0.Writer): _m0.Writer;
137
+ decode(input: _m0.Reader | Uint8Array, length?: number): ShareParam_ParamsEntry;
138
+ fromJSON(object: any): ShareParam_ParamsEntry;
139
+ toJSON(message: ShareParam_ParamsEntry): unknown;
140
+ create(base?: DeepPartial<ShareParam_ParamsEntry>): ShareParam_ParamsEntry;
141
+ fromPartial(object: DeepPartial<ShareParam_ParamsEntry>): ShareParam_ParamsEntry;
142
+ };
47
143
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
48
144
  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 {} ? {
49
145
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../../../src/types/devvit/ui/effects/web_view/v1alpha/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,4JAA4J;IAC5J,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,SAAS,CAAC;CACpD;AAMD,eAAO,MAAM,cAAc;;oBAGT,cAAc,WAAU,GAAG,CAAC,MAAM,GAAyB,GAAG,CAAC,MAAM;kBAsBvE,GAAG,CAAC,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,cAAc;qBA0DtD,GAAG,GAAG,cAAc;oBAWrB,cAAc,GAAG,OAAO;kBAuB1B,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc;wBAGtC,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc;CAUjE,CAAC;AAQF,eAAO,MAAM,cAAc;;oBAGT,cAAc,WAAU,GAAG,CAAC,MAAM,GAAyB,GAAG,CAAC,MAAM;kBAOvE,GAAG,CAAC,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,cAAc;qBAuBtD,GAAG,GAAG,cAAc;oBAIrB,cAAc,GAAG,OAAO;kBAQ1B,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc;wBAGtC,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc;CAKjE,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"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../../../src/types/devvit/ui/effects/web_view/v1alpha/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,UAAU,CAAC,EACP,UAAU,GACV,SAAS,CAAC;IACd;;;;OAIG;IACH,cAAc,CAAC,EACX,cAAc,GACd,SAAS,CAAC;IACd;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,kBAAkB;AAClB,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,MAA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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"}
@@ -8,6 +8,122 @@
8
8
  import _m0 from "protobufjs/minimal.js";
9
9
  import { Struct } from "../../../../../google/protobuf/struct.js";
10
10
  import { messageTypeRegistry } from "../../../../../typeRegistry.js";
11
+ function createBaseBridgeContext() {
12
+ return { postData: undefined, shareParam: undefined, webViewContext: undefined, webbitToken: "", devvitDebug: "" };
13
+ }
14
+ export const BridgeContext = {
15
+ $type: "devvit.ui.effects.web_view.v1alpha.BridgeContext",
16
+ encode(message, writer = _m0.Writer.create()) {
17
+ if (message.postData !== undefined) {
18
+ DevvitPostData.encode(message.postData, writer.uint32(10).fork()).ldelim();
19
+ }
20
+ if (message.shareParam !== undefined) {
21
+ ShareParam.encode(message.shareParam, writer.uint32(18).fork()).ldelim();
22
+ }
23
+ if (message.webViewContext !== undefined) {
24
+ WebViewContext.encode(message.webViewContext, writer.uint32(26).fork()).ldelim();
25
+ }
26
+ if (message.webbitToken !== "") {
27
+ writer.uint32(34).string(message.webbitToken);
28
+ }
29
+ if (message.devvitDebug !== "") {
30
+ writer.uint32(42).string(message.devvitDebug);
31
+ }
32
+ return writer;
33
+ },
34
+ decode(input, length) {
35
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
36
+ let end = length === undefined ? reader.len : reader.pos + length;
37
+ const message = createBaseBridgeContext();
38
+ while (reader.pos < end) {
39
+ const tag = reader.uint32();
40
+ switch (tag >>> 3) {
41
+ case 1:
42
+ if (tag !== 10) {
43
+ break;
44
+ }
45
+ message.postData = DevvitPostData.decode(reader, reader.uint32());
46
+ continue;
47
+ case 2:
48
+ if (tag !== 18) {
49
+ break;
50
+ }
51
+ message.shareParam = ShareParam.decode(reader, reader.uint32());
52
+ continue;
53
+ case 3:
54
+ if (tag !== 26) {
55
+ break;
56
+ }
57
+ message.webViewContext = WebViewContext.decode(reader, reader.uint32());
58
+ continue;
59
+ case 4:
60
+ if (tag !== 34) {
61
+ break;
62
+ }
63
+ message.webbitToken = reader.string();
64
+ continue;
65
+ case 5:
66
+ if (tag !== 42) {
67
+ break;
68
+ }
69
+ message.devvitDebug = reader.string();
70
+ continue;
71
+ }
72
+ if ((tag & 7) === 4 || tag === 0) {
73
+ break;
74
+ }
75
+ reader.skipType(tag & 7);
76
+ }
77
+ return message;
78
+ },
79
+ fromJSON(object) {
80
+ return {
81
+ postData: isSet(object.postData) ? DevvitPostData.fromJSON(object.postData) : undefined,
82
+ shareParam: isSet(object.shareParam) ? ShareParam.fromJSON(object.shareParam) : undefined,
83
+ webViewContext: isSet(object.webViewContext) ? WebViewContext.fromJSON(object.webViewContext) : undefined,
84
+ webbitToken: isSet(object.webbitToken) ? globalThis.String(object.webbitToken) : "",
85
+ devvitDebug: isSet(object.devvitDebug) ? globalThis.String(object.devvitDebug) : "",
86
+ };
87
+ },
88
+ toJSON(message) {
89
+ const obj = {};
90
+ if (message.postData !== undefined) {
91
+ obj.postData = DevvitPostData.toJSON(message.postData);
92
+ }
93
+ if (message.shareParam !== undefined) {
94
+ obj.shareParam = ShareParam.toJSON(message.shareParam);
95
+ }
96
+ if (message.webViewContext !== undefined) {
97
+ obj.webViewContext = WebViewContext.toJSON(message.webViewContext);
98
+ }
99
+ if (message.webbitToken !== "") {
100
+ obj.webbitToken = message.webbitToken;
101
+ }
102
+ if (message.devvitDebug !== "") {
103
+ obj.devvitDebug = message.devvitDebug;
104
+ }
105
+ return obj;
106
+ },
107
+ create(base) {
108
+ return BridgeContext.fromPartial(base ?? {});
109
+ },
110
+ fromPartial(object) {
111
+ const message = createBaseBridgeContext();
112
+ message.postData = (object.postData !== undefined && object.postData !== null)
113
+ ? DevvitPostData.fromPartial(object.postData)
114
+ : undefined;
115
+ message.shareParam = (object.shareParam !== undefined && object.shareParam !== null)
116
+ ? ShareParam.fromPartial(object.shareParam)
117
+ : undefined;
118
+ message.webViewContext = (object.webViewContext !== undefined && object.webViewContext !== null)
119
+ ? WebViewContext.fromPartial(object.webViewContext)
120
+ : undefined;
121
+ message.webbitToken = object.webbitToken ?? "";
122
+ message.devvitDebug = object.devvitDebug ?? "";
123
+ return message;
124
+ },
125
+ };
126
+ messageTypeRegistry.set(BridgeContext.$type, BridgeContext);
11
127
  function createBaseWebViewContext() {
12
128
  return { subredditId: "", subredditName: "", userId: "", appName: "", appVersion: "", postId: "" };
13
129
  }
@@ -184,6 +300,175 @@ export const DevvitPostData = {
184
300
  },
185
301
  };
186
302
  messageTypeRegistry.set(DevvitPostData.$type, DevvitPostData);
303
+ function createBaseShareParam() {
304
+ return { path: "", params: {}, hash: "" };
305
+ }
306
+ export const ShareParam = {
307
+ $type: "devvit.ui.effects.web_view.v1alpha.ShareParam",
308
+ encode(message, writer = _m0.Writer.create()) {
309
+ if (message.path !== "") {
310
+ writer.uint32(10).string(message.path);
311
+ }
312
+ Object.entries(message.params).forEach(([key, value]) => {
313
+ ShareParam_ParamsEntry.encode({ key: key, value }, writer.uint32(18).fork()).ldelim();
314
+ });
315
+ if (message.hash !== "") {
316
+ writer.uint32(26).string(message.hash);
317
+ }
318
+ return writer;
319
+ },
320
+ decode(input, length) {
321
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
322
+ let end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseShareParam();
324
+ while (reader.pos < end) {
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1:
328
+ if (tag !== 10) {
329
+ break;
330
+ }
331
+ message.path = reader.string();
332
+ continue;
333
+ case 2:
334
+ if (tag !== 18) {
335
+ break;
336
+ }
337
+ const entry2 = ShareParam_ParamsEntry.decode(reader, reader.uint32());
338
+ if (entry2.value !== undefined) {
339
+ message.params[entry2.key] = entry2.value;
340
+ }
341
+ continue;
342
+ case 3:
343
+ if (tag !== 26) {
344
+ break;
345
+ }
346
+ message.hash = reader.string();
347
+ continue;
348
+ }
349
+ if ((tag & 7) === 4 || tag === 0) {
350
+ break;
351
+ }
352
+ reader.skipType(tag & 7);
353
+ }
354
+ return message;
355
+ },
356
+ fromJSON(object) {
357
+ return {
358
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
359
+ params: isObject(object.params)
360
+ ? Object.entries(object.params).reduce((acc, [key, value]) => {
361
+ acc[key] = String(value);
362
+ return acc;
363
+ }, {})
364
+ : {},
365
+ hash: isSet(object.hash) ? globalThis.String(object.hash) : "",
366
+ };
367
+ },
368
+ toJSON(message) {
369
+ const obj = {};
370
+ if (message.path !== "") {
371
+ obj.path = message.path;
372
+ }
373
+ if (message.params) {
374
+ const entries = Object.entries(message.params);
375
+ if (entries.length > 0) {
376
+ obj.params = {};
377
+ entries.forEach(([k, v]) => {
378
+ obj.params[k] = v;
379
+ });
380
+ }
381
+ }
382
+ if (message.hash !== "") {
383
+ obj.hash = message.hash;
384
+ }
385
+ return obj;
386
+ },
387
+ create(base) {
388
+ return ShareParam.fromPartial(base ?? {});
389
+ },
390
+ fromPartial(object) {
391
+ const message = createBaseShareParam();
392
+ message.path = object.path ?? "";
393
+ message.params = Object.entries(object.params ?? {}).reduce((acc, [key, value]) => {
394
+ if (value !== undefined) {
395
+ acc[key] = globalThis.String(value);
396
+ }
397
+ return acc;
398
+ }, {});
399
+ message.hash = object.hash ?? "";
400
+ return message;
401
+ },
402
+ };
403
+ messageTypeRegistry.set(ShareParam.$type, ShareParam);
404
+ function createBaseShareParam_ParamsEntry() {
405
+ return { key: "", value: "" };
406
+ }
407
+ export const ShareParam_ParamsEntry = {
408
+ $type: "devvit.ui.effects.web_view.v1alpha.ShareParam.ParamsEntry",
409
+ encode(message, writer = _m0.Writer.create()) {
410
+ if (message.key !== "") {
411
+ writer.uint32(10).string(message.key);
412
+ }
413
+ if (message.value !== "") {
414
+ writer.uint32(18).string(message.value);
415
+ }
416
+ return writer;
417
+ },
418
+ decode(input, length) {
419
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
420
+ let end = length === undefined ? reader.len : reader.pos + length;
421
+ const message = createBaseShareParam_ParamsEntry();
422
+ while (reader.pos < end) {
423
+ const tag = reader.uint32();
424
+ switch (tag >>> 3) {
425
+ case 1:
426
+ if (tag !== 10) {
427
+ break;
428
+ }
429
+ message.key = reader.string();
430
+ continue;
431
+ case 2:
432
+ if (tag !== 18) {
433
+ break;
434
+ }
435
+ message.value = reader.string();
436
+ continue;
437
+ }
438
+ if ((tag & 7) === 4 || tag === 0) {
439
+ break;
440
+ }
441
+ reader.skipType(tag & 7);
442
+ }
443
+ return message;
444
+ },
445
+ fromJSON(object) {
446
+ return {
447
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
448
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
449
+ };
450
+ },
451
+ toJSON(message) {
452
+ const obj = {};
453
+ if (message.key !== "") {
454
+ obj.key = message.key;
455
+ }
456
+ if (message.value !== "") {
457
+ obj.value = message.value;
458
+ }
459
+ return obj;
460
+ },
461
+ create(base) {
462
+ return ShareParam_ParamsEntry.fromPartial(base ?? {});
463
+ },
464
+ fromPartial(object) {
465
+ const message = createBaseShareParam_ParamsEntry();
466
+ message.key = object.key ?? "";
467
+ message.value = object.value ?? "";
468
+ return message;
469
+ },
470
+ };
471
+ messageTypeRegistry.set(ShareParam_ParamsEntry.$type, ShareParam_ParamsEntry);
187
472
  function isObject(value) {
188
473
  return typeof value === "object" && value !== null;
189
474
  }