@devvit/public-api 0.11.8 → 0.11.9-next-2025-03-10-b662c4c32.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.
- package/apis/reddit/common.d.ts +7 -0
- package/apis/reddit/common.d.ts.map +1 -0
- package/apis/reddit/common.js +5 -0
- package/apis/reddit/models/Comment.d.ts.map +1 -1
- package/apis/reddit/models/Comment.js +3 -0
- package/apis/reddit/models/Post.d.ts.map +1 -1
- package/apis/reddit/models/Post.js +7 -0
- package/meta.json +38 -9
- package/meta.min.json +35 -6
- package/package.json +6 -6
- package/public-api.d.ts +71 -1
- package/public-api.iife.js +169 -13
- package/public-api.min.js +6 -6
- package/public-api.min.js.map +4 -4
- package/version.json +5 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RunAs as _RunAs } from '@devvit/protos/types/devvit/plugin/redditapi/common/common_msg.js';
|
|
2
|
+
export declare const RunAs: {
|
|
3
|
+
readonly APP: _RunAs.APP;
|
|
4
|
+
readonly USER: _RunAs.USER;
|
|
5
|
+
};
|
|
6
|
+
export type RunAs = (typeof RunAs)[keyof typeof RunAs];
|
|
7
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/apis/reddit/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mEAAmE,CAAC;AAEpG,eAAO,MAAM,KAAK;;;CAGR,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comment.d.ts","sourceRoot":"","sources":["../../../../src/apis/reddit/models/Comment.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACxF,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e,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtC;;;;;;OAMG;IACH,cAAc,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA0d/E"}
|
|
@@ -13,6 +13,7 @@ var _a, _Comment_id, _Comment_authorId, _Comment_authorName, _Comment_body, _Com
|
|
|
13
13
|
import { assertNonNull } from '@devvit/shared-types/NonNull.js';
|
|
14
14
|
import { asT1ID, asT2ID, asT3ID, asT5ID, isCommentId, isT1ID } from '@devvit/shared-types/tid.js';
|
|
15
15
|
import { Devvit } from '../../../devvit/Devvit.js';
|
|
16
|
+
import { RunAs } from '../common.js';
|
|
16
17
|
import { makeGettersEnumerable } from '../helpers/makeGettersEnumerable.js';
|
|
17
18
|
import { richtextToString } from '../helpers/richtextToString.js';
|
|
18
19
|
import { Listing } from './Listing.js';
|
|
@@ -336,6 +337,7 @@ export class Comment {
|
|
|
336
337
|
thingId: id,
|
|
337
338
|
text: 'text' in options ? options.text : '',
|
|
338
339
|
richtextJson: richtextString,
|
|
340
|
+
runAs: RunAs.APP,
|
|
339
341
|
}, metadata);
|
|
340
342
|
if (response.json?.errors?.length) {
|
|
341
343
|
throw new Error('Failed to edit comment');
|
|
@@ -392,6 +394,7 @@ export class Comment {
|
|
|
392
394
|
thingId: id,
|
|
393
395
|
text: 'text' in options ? options.text : '',
|
|
394
396
|
richtextJson: richtextString,
|
|
397
|
+
runAs: RunAs.APP,
|
|
395
398
|
}, metadata);
|
|
396
399
|
// TODO: figure out a better errors to throw
|
|
397
400
|
if (response.json?.errors?.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Post.d.ts","sourceRoot":"","sources":["../../../../src/apis/reddit/models/Post.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,KAAK,EAAE,IAAI,EA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G,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;IAItC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzE;;;;;;OAMG;IACH,cAAc,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E;;;;;;;;;;;;;OAaG;IACG,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;CAuoBrE"}
|
|
@@ -19,6 +19,7 @@ import { fromByteArray } from 'base64-js';
|
|
|
19
19
|
import { Devvit } from '../../../devvit/Devvit.js';
|
|
20
20
|
import { BlocksReconciler } from '../../../devvit/internals/blocks/BlocksReconciler.js';
|
|
21
21
|
import { BlocksHandler } from '../../../devvit/internals/blocks/handler/BlocksHandler.js';
|
|
22
|
+
import { RunAs } from '../common.js';
|
|
22
23
|
import { GraphQL } from '../graphql/GraphQL.js';
|
|
23
24
|
import { makeGettersEnumerable } from '../helpers/makeGettersEnumerable.js';
|
|
24
25
|
import { richtextToString } from '../helpers/richtextToString.js';
|
|
@@ -557,6 +558,8 @@ export class Post {
|
|
|
557
558
|
/** @internal */
|
|
558
559
|
static async submit(options, metadata) {
|
|
559
560
|
const client = Devvit.redditAPIPlugins.LinksAndComments;
|
|
561
|
+
// Temporary change: Always default runAs to 'APP'. The behavior can still be overwritten to runAs: 'USER' using the runAs config.
|
|
562
|
+
const runAs = RunAs.APP;
|
|
560
563
|
let response;
|
|
561
564
|
if ('preview' in options) {
|
|
562
565
|
assertNonNull(metadata, 'Missing metadata in `SubmitPostOptions`');
|
|
@@ -570,6 +573,7 @@ export class Post {
|
|
|
570
573
|
sr: options.subredditName,
|
|
571
574
|
richtextJson: fromByteArray(encodedCached),
|
|
572
575
|
richtextFallback,
|
|
576
|
+
runAs,
|
|
573
577
|
...sanitizedOptions,
|
|
574
578
|
};
|
|
575
579
|
response = await client.SubmitCustomPost(submitRequest, metadata);
|
|
@@ -579,6 +583,7 @@ export class Post {
|
|
|
579
583
|
kind: 'kind' in options ? options.kind : 'url' in options ? 'link' : 'self',
|
|
580
584
|
sr: options.subredditName,
|
|
581
585
|
richtextJson: 'richtext' in options ? richtextToString(options.richtext) : undefined,
|
|
586
|
+
runAs,
|
|
582
587
|
...options,
|
|
583
588
|
}, metadata);
|
|
584
589
|
}
|
|
@@ -605,6 +610,7 @@ export class Post {
|
|
|
605
610
|
kind: 'crosspost',
|
|
606
611
|
sr: subredditName,
|
|
607
612
|
crosspostFullname: asT3ID(postId),
|
|
613
|
+
runAs: RunAs.APP,
|
|
608
614
|
...rest,
|
|
609
615
|
}, metadata);
|
|
610
616
|
if (!response.json?.data?.id || response.json?.errors?.length) {
|
|
@@ -624,6 +630,7 @@ export class Post {
|
|
|
624
630
|
thingId: id,
|
|
625
631
|
text: 'text' in options ? options.text : '',
|
|
626
632
|
richtextJson: richtextString,
|
|
633
|
+
runAs: RunAs.APP,
|
|
627
634
|
}, metadata);
|
|
628
635
|
if (response.json?.errors?.length) {
|
|
629
636
|
throw new Error('Failed to edit post');
|
package/meta.json
CHANGED
|
@@ -816,7 +816,7 @@
|
|
|
816
816
|
"format": "esm"
|
|
817
817
|
},
|
|
818
818
|
"../protos/dist/types/devvit/plugin/redditapi/common/common_msg.js": {
|
|
819
|
-
"bytes":
|
|
819
|
+
"bytes": 168936,
|
|
820
820
|
"imports": [
|
|
821
821
|
{
|
|
822
822
|
"path": "../../node_modules/protobufjs/minimal.js",
|
|
@@ -5972,7 +5972,7 @@
|
|
|
5972
5972
|
"format": "esm"
|
|
5973
5973
|
},
|
|
5974
5974
|
"../protos/dist/types/devvit/plugin/redditapi/linksandcomments/linksandcomments_msg.js": {
|
|
5975
|
-
"bytes":
|
|
5975
|
+
"bytes": 77407,
|
|
5976
5976
|
"imports": [
|
|
5977
5977
|
{
|
|
5978
5978
|
"path": "../../node_modules/protobufjs/minimal.js",
|
|
@@ -6003,6 +6003,11 @@
|
|
|
6003
6003
|
"path": "../protos/dist/types/devvit/reddit/comment.js",
|
|
6004
6004
|
"kind": "import-statement",
|
|
6005
6005
|
"original": "../../../reddit/comment.js"
|
|
6006
|
+
},
|
|
6007
|
+
{
|
|
6008
|
+
"path": "../protos/dist/types/devvit/plugin/redditapi/common/common_msg.js",
|
|
6009
|
+
"kind": "import-statement",
|
|
6010
|
+
"original": "../common/common_msg.js"
|
|
6006
6011
|
}
|
|
6007
6012
|
],
|
|
6008
6013
|
"format": "esm"
|
|
@@ -8827,6 +8832,17 @@
|
|
|
8827
8832
|
],
|
|
8828
8833
|
"format": "esm"
|
|
8829
8834
|
},
|
|
8835
|
+
"src/apis/reddit/common.ts": {
|
|
8836
|
+
"bytes": 234,
|
|
8837
|
+
"imports": [
|
|
8838
|
+
{
|
|
8839
|
+
"path": "../protos/dist/types/devvit/plugin/redditapi/common/common_msg.js",
|
|
8840
|
+
"kind": "import-statement",
|
|
8841
|
+
"original": "@devvit/protos/types/devvit/plugin/redditapi/common/common_msg.js"
|
|
8842
|
+
}
|
|
8843
|
+
],
|
|
8844
|
+
"format": "esm"
|
|
8845
|
+
},
|
|
8830
8846
|
"src/apis/reddit/helpers/makeGettersEnumerable.ts": {
|
|
8831
8847
|
"bytes": 968,
|
|
8832
8848
|
"imports": [],
|
|
@@ -9002,7 +9018,7 @@
|
|
|
9002
9018
|
"format": "esm"
|
|
9003
9019
|
},
|
|
9004
9020
|
"src/apis/reddit/models/Post.ts": {
|
|
9005
|
-
"bytes":
|
|
9021
|
+
"bytes": 44666,
|
|
9006
9022
|
"imports": [
|
|
9007
9023
|
{
|
|
9008
9024
|
"path": "../protos/dist/index.js",
|
|
@@ -9049,6 +9065,11 @@
|
|
|
9049
9065
|
"kind": "import-statement",
|
|
9050
9066
|
"original": "../../../devvit/internals/blocks/handler/BlocksHandler.js"
|
|
9051
9067
|
},
|
|
9068
|
+
{
|
|
9069
|
+
"path": "src/apis/reddit/common.ts",
|
|
9070
|
+
"kind": "import-statement",
|
|
9071
|
+
"original": "../common.js"
|
|
9072
|
+
},
|
|
9052
9073
|
{
|
|
9053
9074
|
"path": "src/apis/reddit/graphql/GraphQL.ts",
|
|
9054
9075
|
"kind": "import-statement",
|
|
@@ -9164,7 +9185,7 @@
|
|
|
9164
9185
|
"format": "esm"
|
|
9165
9186
|
},
|
|
9166
9187
|
"src/apis/reddit/models/Comment.ts": {
|
|
9167
|
-
"bytes":
|
|
9188
|
+
"bytes": 23625,
|
|
9168
9189
|
"imports": [
|
|
9169
9190
|
{
|
|
9170
9191
|
"path": "../shared-types/dist/NonNull.js",
|
|
@@ -9181,6 +9202,11 @@
|
|
|
9181
9202
|
"kind": "import-statement",
|
|
9182
9203
|
"original": "../../../devvit/Devvit.js"
|
|
9183
9204
|
},
|
|
9205
|
+
{
|
|
9206
|
+
"path": "src/apis/reddit/common.ts",
|
|
9207
|
+
"kind": "import-statement",
|
|
9208
|
+
"original": "../common.js"
|
|
9209
|
+
},
|
|
9184
9210
|
{
|
|
9185
9211
|
"path": "src/apis/reddit/helpers/makeGettersEnumerable.ts",
|
|
9186
9212
|
"kind": "import-statement",
|
|
@@ -9803,7 +9829,7 @@
|
|
|
9803
9829
|
"bytesInOutput": 22818
|
|
9804
9830
|
},
|
|
9805
9831
|
"../protos/dist/types/devvit/plugin/redditapi/common/common_msg.js": {
|
|
9806
|
-
"bytesInOutput":
|
|
9832
|
+
"bytesInOutput": 150146
|
|
9807
9833
|
},
|
|
9808
9834
|
"../protos/dist/types/google/protobuf/any.js": {
|
|
9809
9835
|
"bytesInOutput": 2826
|
|
@@ -9923,7 +9949,7 @@
|
|
|
9923
9949
|
"bytesInOutput": 9865
|
|
9924
9950
|
},
|
|
9925
9951
|
"../protos/dist/types/devvit/plugin/redditapi/linksandcomments/linksandcomments_msg.js": {
|
|
9926
|
-
"bytesInOutput":
|
|
9952
|
+
"bytesInOutput": 70562
|
|
9927
9953
|
},
|
|
9928
9954
|
"../protos/dist/types/devvit/reddit/comment.js": {
|
|
9929
9955
|
"bytesInOutput": 50318
|
|
@@ -10228,6 +10254,9 @@
|
|
|
10228
10254
|
"src/devvit/Devvit.ts": {
|
|
10229
10255
|
"bytesInOutput": 18326
|
|
10230
10256
|
},
|
|
10257
|
+
"src/apis/reddit/common.ts": {
|
|
10258
|
+
"bytesInOutput": 63
|
|
10259
|
+
},
|
|
10231
10260
|
"src/apis/reddit/helpers/makeGettersEnumerable.ts": {
|
|
10232
10261
|
"bytesInOutput": 344
|
|
10233
10262
|
},
|
|
@@ -10262,7 +10291,7 @@
|
|
|
10262
10291
|
"bytesInOutput": 12100
|
|
10263
10292
|
},
|
|
10264
10293
|
"src/apis/reddit/models/Post.ts": {
|
|
10265
|
-
"bytesInOutput":
|
|
10294
|
+
"bytesInOutput": 35961
|
|
10266
10295
|
},
|
|
10267
10296
|
"src/apis/reddit/helpers/textFallbackToRichtext.ts": {
|
|
10268
10297
|
"bytesInOutput": 455
|
|
@@ -10271,7 +10300,7 @@
|
|
|
10271
10300
|
"bytesInOutput": 16886
|
|
10272
10301
|
},
|
|
10273
10302
|
"src/apis/reddit/models/Comment.ts": {
|
|
10274
|
-
"bytesInOutput":
|
|
10303
|
+
"bytesInOutput": 22627
|
|
10275
10304
|
},
|
|
10276
10305
|
"src/apis/reddit/models/index.ts": {
|
|
10277
10306
|
"bytesInOutput": 0
|
|
@@ -10307,7 +10336,7 @@
|
|
|
10307
10336
|
"bytesInOutput": 2975
|
|
10308
10337
|
}
|
|
10309
10338
|
},
|
|
10310
|
-
"bytes":
|
|
10339
|
+
"bytes": 12454337
|
|
10311
10340
|
}
|
|
10312
10341
|
}
|
|
10313
10342
|
}
|
package/meta.min.json
CHANGED
|
@@ -1672,6 +1672,17 @@
|
|
|
1672
1672
|
],
|
|
1673
1673
|
"format": "esm"
|
|
1674
1674
|
},
|
|
1675
|
+
"src/apis/reddit/common.ts": {
|
|
1676
|
+
"bytes": 234,
|
|
1677
|
+
"imports": [
|
|
1678
|
+
{
|
|
1679
|
+
"path": "@devvit/protos/types/devvit/plugin/redditapi/common/common_msg.js",
|
|
1680
|
+
"kind": "import-statement",
|
|
1681
|
+
"external": true
|
|
1682
|
+
}
|
|
1683
|
+
],
|
|
1684
|
+
"format": "esm"
|
|
1685
|
+
},
|
|
1675
1686
|
"src/apis/reddit/helpers/makeGettersEnumerable.ts": {
|
|
1676
1687
|
"bytes": 968,
|
|
1677
1688
|
"imports": [],
|
|
@@ -1847,7 +1858,7 @@
|
|
|
1847
1858
|
"format": "esm"
|
|
1848
1859
|
},
|
|
1849
1860
|
"src/apis/reddit/models/Post.ts": {
|
|
1850
|
-
"bytes":
|
|
1861
|
+
"bytes": 44666,
|
|
1851
1862
|
"imports": [
|
|
1852
1863
|
{
|
|
1853
1864
|
"path": "@devvit/protos",
|
|
@@ -1894,6 +1905,11 @@
|
|
|
1894
1905
|
"kind": "import-statement",
|
|
1895
1906
|
"original": "../../../devvit/internals/blocks/handler/BlocksHandler.js"
|
|
1896
1907
|
},
|
|
1908
|
+
{
|
|
1909
|
+
"path": "src/apis/reddit/common.ts",
|
|
1910
|
+
"kind": "import-statement",
|
|
1911
|
+
"original": "../common.js"
|
|
1912
|
+
},
|
|
1897
1913
|
{
|
|
1898
1914
|
"path": "src/apis/reddit/graphql/GraphQL.ts",
|
|
1899
1915
|
"kind": "import-statement",
|
|
@@ -2009,7 +2025,7 @@
|
|
|
2009
2025
|
"format": "esm"
|
|
2010
2026
|
},
|
|
2011
2027
|
"src/apis/reddit/models/Comment.ts": {
|
|
2012
|
-
"bytes":
|
|
2028
|
+
"bytes": 23625,
|
|
2013
2029
|
"imports": [
|
|
2014
2030
|
{
|
|
2015
2031
|
"path": "../shared-types/dist/NonNull.js",
|
|
@@ -2026,6 +2042,11 @@
|
|
|
2026
2042
|
"kind": "import-statement",
|
|
2027
2043
|
"original": "../../../devvit/Devvit.js"
|
|
2028
2044
|
},
|
|
2045
|
+
{
|
|
2046
|
+
"path": "src/apis/reddit/common.ts",
|
|
2047
|
+
"kind": "import-statement",
|
|
2048
|
+
"original": "../common.js"
|
|
2049
|
+
},
|
|
2029
2050
|
{
|
|
2030
2051
|
"path": "src/apis/reddit/helpers/makeGettersEnumerable.ts",
|
|
2031
2052
|
"kind": "import-statement",
|
|
@@ -2496,7 +2517,7 @@
|
|
|
2496
2517
|
"imports": [],
|
|
2497
2518
|
"exports": [],
|
|
2498
2519
|
"inputs": {},
|
|
2499
|
-
"bytes":
|
|
2520
|
+
"bytes": 1058082
|
|
2500
2521
|
},
|
|
2501
2522
|
"dist/public-api.min.js": {
|
|
2502
2523
|
"imports": [
|
|
@@ -2635,6 +2656,11 @@
|
|
|
2635
2656
|
"kind": "import-statement",
|
|
2636
2657
|
"external": true
|
|
2637
2658
|
},
|
|
2659
|
+
{
|
|
2660
|
+
"path": "@devvit/protos/types/devvit/plugin/redditapi/common/common_msg.js",
|
|
2661
|
+
"kind": "import-statement",
|
|
2662
|
+
"external": true
|
|
2663
|
+
},
|
|
2638
2664
|
{
|
|
2639
2665
|
"path": "@devvit/protos",
|
|
2640
2666
|
"kind": "import-statement",
|
|
@@ -2959,6 +2985,9 @@
|
|
|
2959
2985
|
"src/devvit/internals/upgrade-app-shim.tsx": {
|
|
2960
2986
|
"bytesInOutput": 2170
|
|
2961
2987
|
},
|
|
2988
|
+
"src/apis/reddit/common.ts": {
|
|
2989
|
+
"bytesInOutput": 124
|
|
2990
|
+
},
|
|
2962
2991
|
"src/apis/reddit/helpers/makeGettersEnumerable.ts": {
|
|
2963
2992
|
"bytesInOutput": 166
|
|
2964
2993
|
},
|
|
@@ -2993,7 +3022,7 @@
|
|
|
2993
3022
|
"bytesInOutput": 4610
|
|
2994
3023
|
},
|
|
2995
3024
|
"src/apis/reddit/models/Post.ts": {
|
|
2996
|
-
"bytesInOutput":
|
|
3025
|
+
"bytesInOutput": 14893
|
|
2997
3026
|
},
|
|
2998
3027
|
"src/apis/reddit/helpers/textFallbackToRichtext.ts": {
|
|
2999
3028
|
"bytesInOutput": 114
|
|
@@ -3002,7 +3031,7 @@
|
|
|
3002
3031
|
"bytesInOutput": 6302
|
|
3003
3032
|
},
|
|
3004
3033
|
"src/apis/reddit/models/Comment.ts": {
|
|
3005
|
-
"bytesInOutput":
|
|
3034
|
+
"bytesInOutput": 9567
|
|
3006
3035
|
},
|
|
3007
3036
|
"src/apis/reddit/models/index.ts": {
|
|
3008
3037
|
"bytesInOutput": 0
|
|
@@ -3041,7 +3070,7 @@
|
|
|
3041
3070
|
"bytesInOutput": 1267
|
|
3042
3071
|
}
|
|
3043
3072
|
},
|
|
3044
|
-
"bytes":
|
|
3073
|
+
"bytes": 218599
|
|
3045
3074
|
}
|
|
3046
3075
|
}
|
|
3047
3076
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/public-api",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.9-next-2025-03-10-b662c4c32.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@devvit/protos": "0.11.
|
|
34
|
-
"@devvit/shared-types": "0.11.
|
|
33
|
+
"@devvit/protos": "0.11.9-next-2025-03-10-b662c4c32.0",
|
|
34
|
+
"@devvit/shared-types": "0.11.9-next-2025-03-10-b662c4c32.0",
|
|
35
35
|
"base64-js": "1.5.1",
|
|
36
36
|
"clone-deep": "4.0.1",
|
|
37
37
|
"moderndash": "4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@ampproject/filesize": "4.3.0",
|
|
41
|
-
"@devvit/repo-tools": "0.11.
|
|
42
|
-
"@devvit/tsconfig": "0.11.
|
|
41
|
+
"@devvit/repo-tools": "0.11.9-next-2025-03-10-b662c4c32.0",
|
|
42
|
+
"@devvit/tsconfig": "0.11.9-next-2025-03-10-b662c4c32.0",
|
|
43
43
|
"@microsoft/api-extractor": "7.41.0",
|
|
44
44
|
"@reddit/faceplate-ui": "18.0.1",
|
|
45
45
|
"@types/clone-deep": "4.0.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"source": "./src/index.ts",
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "d27c77baa60371028ca17cb521f357aea12b4a38"
|
|
64
64
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import _m0 from 'protobufjs/minimal.js';
|
|
|
39
39
|
import { Observable } from 'rxjs';
|
|
40
40
|
import { OrderResultStatus as OrderResultStatus_2 } from '../../../../../payments.js';
|
|
41
41
|
import { RealtimeSubscriptionStatus as RealtimeSubscriptionStatus_2 } from '../../../../../index.js';
|
|
42
|
+
import { RunAs as RunAs_2 } from '../common/common_msg.js';
|
|
42
43
|
import { SetCustomPostPreviewRequest_BodyType as SetCustomPostPreviewRequest_BodyType_2 } from './linksandcomments_msg.js';
|
|
43
44
|
import { SubredditRating as SubredditRating_2 } from '../../../reddit/v2alpha/subredditv2.js';
|
|
44
45
|
import { SubredditType as SubredditType_3 } from '../../../reddit/v2alpha/subredditv2.js';
|
|
@@ -3425,6 +3426,8 @@ declare interface CommentRequest {
|
|
|
3425
3426
|
* @example "t3_abc123"
|
|
3426
3427
|
*/
|
|
3427
3428
|
thingId: string;
|
|
3429
|
+
/** Indicates who the Comment should be created as */
|
|
3430
|
+
runAs: RunAs;
|
|
3428
3431
|
}
|
|
3429
3432
|
|
|
3430
3433
|
declare const CommentRequest: {
|
|
@@ -13702,11 +13705,13 @@ declare const LinksAndCommentsDefinition: {
|
|
|
13702
13705
|
richtextJson?: string | undefined;
|
|
13703
13706
|
text?: string;
|
|
13704
13707
|
thingId?: string;
|
|
13708
|
+
runAs?: RunAs_2;
|
|
13705
13709
|
} | undefined): CommentRequest;
|
|
13706
13710
|
fromPartial(object: {
|
|
13707
13711
|
richtextJson?: string | undefined;
|
|
13708
13712
|
text?: string;
|
|
13709
13713
|
thingId?: string;
|
|
13714
|
+
runAs?: RunAs_2;
|
|
13710
13715
|
}): CommentRequest;
|
|
13711
13716
|
};
|
|
13712
13717
|
readonly requestStream: false;
|
|
@@ -14092,11 +14097,13 @@ declare const LinksAndCommentsDefinition: {
|
|
|
14092
14097
|
richtextJson?: string | undefined;
|
|
14093
14098
|
text?: string;
|
|
14094
14099
|
thingId?: string;
|
|
14100
|
+
runAs?: RunAs_2;
|
|
14095
14101
|
} | undefined): CommentRequest;
|
|
14096
14102
|
fromPartial(object: {
|
|
14097
14103
|
richtextJson?: string | undefined;
|
|
14098
14104
|
text?: string;
|
|
14099
14105
|
thingId?: string;
|
|
14106
|
+
runAs?: RunAs_2;
|
|
14100
14107
|
}): CommentRequest;
|
|
14101
14108
|
};
|
|
14102
14109
|
readonly requestStream: false;
|
|
@@ -15329,7 +15336,13 @@ declare const LinksAndCommentsDefinition: {
|
|
|
15329
15336
|
encode(message: ReportRequest, writer?: _m0.Writer): _m0.Writer;
|
|
15330
15337
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ReportRequest;
|
|
15331
15338
|
fromJSON(object: any): ReportRequest;
|
|
15332
|
-
toJSON(message: ReportRequest): unknown;
|
|
15339
|
+
toJSON(message: ReportRequest): unknown; /**
|
|
15340
|
+
* Toggle Contest Mode for a Post's comments
|
|
15341
|
+
*
|
|
15342
|
+
* Contest Mode randomizes the sort order and hides the vote score for comments
|
|
15343
|
+
*
|
|
15344
|
+
* @see {@link https://www.reddit.com/dev/api#POST_api_set_contest_mode}
|
|
15345
|
+
*/
|
|
15333
15346
|
create(base?: {
|
|
15334
15347
|
additionalInfo?: string | undefined;
|
|
15335
15348
|
customText?: string | undefined;
|
|
@@ -16135,6 +16148,11 @@ declare const LinksAndCommentsDefinition: {
|
|
|
16135
16148
|
crosspostFullname?: string | undefined;
|
|
16136
16149
|
richtextFallback?: string | undefined;
|
|
16137
16150
|
imageUrls?: any[] | undefined;
|
|
16151
|
+
runAs?: RunAs_2;
|
|
16152
|
+
userGeneratedContent?: {
|
|
16153
|
+
text?: string;
|
|
16154
|
+
imageUrls?: string[];
|
|
16155
|
+
} | undefined;
|
|
16138
16156
|
} | undefined): SubmitRequest;
|
|
16139
16157
|
fromPartial(object: {
|
|
16140
16158
|
collectionId?: string | undefined;
|
|
@@ -16153,6 +16171,11 @@ declare const LinksAndCommentsDefinition: {
|
|
|
16153
16171
|
crosspostFullname?: string | undefined;
|
|
16154
16172
|
richtextFallback?: string | undefined;
|
|
16155
16173
|
imageUrls?: any[] | undefined;
|
|
16174
|
+
runAs?: RunAs_2;
|
|
16175
|
+
userGeneratedContent?: {
|
|
16176
|
+
text?: string;
|
|
16177
|
+
imageUrls?: string[];
|
|
16178
|
+
} | undefined;
|
|
16156
16179
|
}): SubmitRequest;
|
|
16157
16180
|
};
|
|
16158
16181
|
readonly requestStream: false;
|
|
@@ -16220,6 +16243,11 @@ declare const LinksAndCommentsDefinition: {
|
|
|
16220
16243
|
crosspostFullname?: string | undefined;
|
|
16221
16244
|
richtextFallback?: string | undefined;
|
|
16222
16245
|
imageUrls?: any[] | undefined;
|
|
16246
|
+
runAs?: RunAs_2;
|
|
16247
|
+
userGeneratedContent?: {
|
|
16248
|
+
text?: string;
|
|
16249
|
+
imageUrls?: string[];
|
|
16250
|
+
} | undefined;
|
|
16223
16251
|
} | undefined): SubmitRequest;
|
|
16224
16252
|
fromPartial(object: {
|
|
16225
16253
|
collectionId?: string | undefined;
|
|
@@ -16238,6 +16266,11 @@ declare const LinksAndCommentsDefinition: {
|
|
|
16238
16266
|
crosspostFullname?: string | undefined;
|
|
16239
16267
|
richtextFallback?: string | undefined;
|
|
16240
16268
|
imageUrls?: any[] | undefined;
|
|
16269
|
+
runAs?: RunAs_2;
|
|
16270
|
+
userGeneratedContent?: {
|
|
16271
|
+
text?: string;
|
|
16272
|
+
imageUrls?: string[];
|
|
16273
|
+
} | undefined;
|
|
16241
16274
|
}): SubmitRequest;
|
|
16242
16275
|
};
|
|
16243
16276
|
readonly requestStream: false;
|
|
@@ -36463,8 +36496,11 @@ declare namespace protos {
|
|
|
36463
36496
|
Modlog,
|
|
36464
36497
|
ModlogServiceName,
|
|
36465
36498
|
ModlogClientImpl,
|
|
36499
|
+
runAsFromJSON,
|
|
36500
|
+
runAsToJSON,
|
|
36466
36501
|
apiClientConfig_BodyTypeFromJSON,
|
|
36467
36502
|
apiClientConfig_BodyTypeToJSON,
|
|
36503
|
+
RunAs,
|
|
36468
36504
|
Listing_2 as Listing,
|
|
36469
36505
|
Listing_ListingData,
|
|
36470
36506
|
WrappedRedditObject,
|
|
@@ -36482,6 +36518,7 @@ declare namespace protos {
|
|
|
36482
36518
|
WrappedUserObject,
|
|
36483
36519
|
ApiClientConfig,
|
|
36484
36520
|
ApiClientConfig_BodyType,
|
|
36521
|
+
UserGeneratedContent,
|
|
36485
36522
|
ClearFlairTemplatesRequest,
|
|
36486
36523
|
DeleteFlairRequest,
|
|
36487
36524
|
DeleteFlairTemplateRequest,
|
|
@@ -41474,6 +41511,17 @@ declare interface Rpc_9 {
|
|
|
41474
41511
|
request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
|
|
41475
41512
|
}
|
|
41476
41513
|
|
|
41514
|
+
/** Indicates who the request should be made on behalf of. Currently, only 'APP' or 'USER' types are supported. */
|
|
41515
|
+
declare enum RunAs {
|
|
41516
|
+
APP = 0,
|
|
41517
|
+
USER = 1,
|
|
41518
|
+
UNRECOGNIZED = -1
|
|
41519
|
+
}
|
|
41520
|
+
|
|
41521
|
+
declare function runAsFromJSON(object: any): RunAs;
|
|
41522
|
+
|
|
41523
|
+
declare function runAsToJSON(object: RunAs): number;
|
|
41524
|
+
|
|
41477
41525
|
/**
|
|
41478
41526
|
* Schedule a new job to run at a specific time or on a cron schedule
|
|
41479
41527
|
* @param job The job to schedule
|
|
@@ -42997,6 +43045,10 @@ declare interface SubmitRequest {
|
|
|
42997
43045
|
richtextFallback?: string | undefined;
|
|
42998
43046
|
/** If `kind` is "image" this must be set to the images URLs */
|
|
42999
43047
|
imageUrls?: Array<any> | undefined;
|
|
43048
|
+
/** Indicates who the Post should be submited as */
|
|
43049
|
+
runAs: RunAs;
|
|
43050
|
+
/** The UserGeneratedContent attached to the Post */
|
|
43051
|
+
userGeneratedContent?: UserGeneratedContent | undefined;
|
|
43000
43052
|
}
|
|
43001
43053
|
|
|
43002
43054
|
declare const SubmitRequest: {
|
|
@@ -51385,6 +51437,24 @@ declare const UserFlairV2: {
|
|
|
51385
51437
|
fromPartial(object: DeepPartial_19<UserFlairV2>): UserFlairV2;
|
|
51386
51438
|
};
|
|
51387
51439
|
|
|
51440
|
+
/** Represents data on the user's content submission */
|
|
51441
|
+
declare interface UserGeneratedContent {
|
|
51442
|
+
/** The text body of the content */
|
|
51443
|
+
text: string;
|
|
51444
|
+
/** The imageUrls attached to the content, if any */
|
|
51445
|
+
imageUrls: string[];
|
|
51446
|
+
}
|
|
51447
|
+
|
|
51448
|
+
declare const UserGeneratedContent: {
|
|
51449
|
+
$type: "devvit.plugin.redditapi.common.UserGeneratedContent";
|
|
51450
|
+
encode(message: UserGeneratedContent, writer?: _m0.Writer): _m0.Writer;
|
|
51451
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): UserGeneratedContent;
|
|
51452
|
+
fromJSON(object: any): UserGeneratedContent;
|
|
51453
|
+
toJSON(message: UserGeneratedContent): unknown;
|
|
51454
|
+
create(base?: DeepPartial_9<UserGeneratedContent>): UserGeneratedContent;
|
|
51455
|
+
fromPartial(object: DeepPartial_9<UserGeneratedContent>): UserGeneratedContent;
|
|
51456
|
+
};
|
|
51457
|
+
|
|
51388
51458
|
declare type UserLink = {
|
|
51389
51459
|
e: typeof USER_LINK_ELEMENT;
|
|
51390
51460
|
t: string;
|