@devvit/client 0.12.1-next-2025-08-25-20-31-24-ed3784f8b.0 → 0.12.1-next-2025-08-26-17-18-36-3b47afc7a.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/client-meta.min.json +8 -8
- package/client.min.js +1 -1
- package/client.min.js.map +3 -3
- package/effects/helpers/test-helpers.d.ts +126 -5
- package/effects/helpers/test-helpers.d.ts.map +1 -1
- package/effects/immersive-mode.js +1 -1
- package/effects/navigate-to.d.ts +3 -6
- package/effects/navigate-to.d.ts.map +1 -1
- package/effects/navigate-to.js +5 -0
- package/package.json +10 -11
|
@@ -1,10 +1,131 @@
|
|
|
1
1
|
import type { Effect } from '@devvit/protos/types/devvit/ui/effects/v1alpha/effect.js';
|
|
2
|
-
import type { Comment, Post, Subreddit, User } from '@devvit/reddit';
|
|
3
2
|
import type { Form } from './form-types.js';
|
|
4
|
-
export declare const mockSubreddit:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export declare const mockSubreddit: {
|
|
4
|
+
readonly id: "t5_123";
|
|
5
|
+
readonly name: "test";
|
|
6
|
+
readonly permalink: "/r/test";
|
|
7
|
+
readonly createdAt: Date;
|
|
8
|
+
readonly type: "public";
|
|
9
|
+
readonly title: "Test Subreddit";
|
|
10
|
+
readonly description: "A test subreddit";
|
|
11
|
+
readonly language: "en";
|
|
12
|
+
readonly nsfw: false;
|
|
13
|
+
readonly numberOfSubscribers: 1000;
|
|
14
|
+
readonly numberOfActiveUsers: 100;
|
|
15
|
+
readonly settings: {
|
|
16
|
+
readonly acceptFollowers: true;
|
|
17
|
+
readonly allOriginalContent: false;
|
|
18
|
+
readonly allowChatPostCreation: true;
|
|
19
|
+
readonly allowDiscovery: true;
|
|
20
|
+
readonly allowGalleries: true;
|
|
21
|
+
readonly allowImages: true;
|
|
22
|
+
readonly allowPolls: true;
|
|
23
|
+
readonly allowPredictionContributors: true;
|
|
24
|
+
readonly allowPredictions: true;
|
|
25
|
+
readonly allowPredictionsTournament: true;
|
|
26
|
+
readonly allowTalks: true;
|
|
27
|
+
readonly allowVideoGifs: true;
|
|
28
|
+
readonly allowVideos: true;
|
|
29
|
+
readonly chatPostEnabled: true;
|
|
30
|
+
readonly collectionsEnabled: true;
|
|
31
|
+
readonly crosspostable: true;
|
|
32
|
+
readonly emojisEnabled: true;
|
|
33
|
+
readonly eventPostsEnabled: true;
|
|
34
|
+
readonly linkFlairEnabled: true;
|
|
35
|
+
readonly originalContentTagEnabled: true;
|
|
36
|
+
readonly restrictCommenting: false;
|
|
37
|
+
readonly restrictPosting: false;
|
|
38
|
+
readonly shouldArchivePosts: true;
|
|
39
|
+
readonly spoilersEnabled: true;
|
|
40
|
+
readonly wikiEnabled: true;
|
|
41
|
+
readonly allowedPostType: "any";
|
|
42
|
+
readonly allowedMediaInComments: readonly ["giphy", "static", "animated", "expression"];
|
|
43
|
+
readonly userFlairs: {
|
|
44
|
+
readonly enabled: true;
|
|
45
|
+
readonly usersCanAssign: true;
|
|
46
|
+
};
|
|
47
|
+
readonly postFlairs: {
|
|
48
|
+
readonly enabled: true;
|
|
49
|
+
readonly usersCanAssign: true;
|
|
50
|
+
};
|
|
51
|
+
readonly url: "https://www.reddit.com/r/test";
|
|
52
|
+
};
|
|
53
|
+
readonly url: "https://www.reddit.com/r/test";
|
|
54
|
+
};
|
|
55
|
+
export declare const mockPost: {
|
|
56
|
+
readonly id: "t3_123";
|
|
57
|
+
readonly title: "Test Post";
|
|
58
|
+
readonly permalink: "/r/test/comments/123/test_post";
|
|
59
|
+
readonly authorId: "t2_456";
|
|
60
|
+
readonly authorName: "testuser";
|
|
61
|
+
readonly subredditId: "t5_123";
|
|
62
|
+
readonly subredditName: "test";
|
|
63
|
+
readonly body: "Test post body";
|
|
64
|
+
readonly bodyHtml: "<div>Test post body</div>";
|
|
65
|
+
readonly url: "https://www.reddit.com/r/test/comments/123/test_post";
|
|
66
|
+
readonly createdAt: Date;
|
|
67
|
+
readonly score: 100;
|
|
68
|
+
readonly numberOfComments: 10;
|
|
69
|
+
readonly numberOfReports: 0;
|
|
70
|
+
readonly approved: true;
|
|
71
|
+
readonly spam: false;
|
|
72
|
+
readonly stickied: false;
|
|
73
|
+
readonly removed: false;
|
|
74
|
+
readonly removedBy: undefined;
|
|
75
|
+
readonly removedByCategory: undefined;
|
|
76
|
+
readonly archived: false;
|
|
77
|
+
readonly edited: false;
|
|
78
|
+
readonly locked: false;
|
|
79
|
+
readonly nsfw: false;
|
|
80
|
+
readonly quarantined: false;
|
|
81
|
+
readonly spoiler: false;
|
|
82
|
+
readonly hidden: false;
|
|
83
|
+
readonly ignoringReports: false;
|
|
84
|
+
readonly distinguishedBy: undefined;
|
|
85
|
+
readonly flair: undefined;
|
|
86
|
+
readonly secureMedia: undefined;
|
|
87
|
+
readonly userReportReasons: readonly [];
|
|
88
|
+
readonly modReportReasons: readonly [];
|
|
89
|
+
};
|
|
90
|
+
export declare const mockComment: {
|
|
91
|
+
readonly id: "t1_123";
|
|
92
|
+
readonly body: "Test comment";
|
|
93
|
+
readonly permalink: "/r/test/comments/123/test_post/comment";
|
|
94
|
+
readonly authorId: "t2_456";
|
|
95
|
+
readonly authorName: "testuser";
|
|
96
|
+
readonly subredditId: "t5_123";
|
|
97
|
+
readonly subredditName: "test";
|
|
98
|
+
readonly createdAt: Date;
|
|
99
|
+
readonly parentId: "t3_123";
|
|
100
|
+
readonly postId: "t3_123";
|
|
101
|
+
readonly approved: true;
|
|
102
|
+
readonly locked: false;
|
|
103
|
+
readonly removed: false;
|
|
104
|
+
readonly stickied: false;
|
|
105
|
+
readonly spam: false;
|
|
106
|
+
readonly edited: false;
|
|
107
|
+
readonly distinguishedBy: undefined;
|
|
108
|
+
readonly numReports: 0;
|
|
109
|
+
readonly collapsedBecauseCrowdControl: false;
|
|
110
|
+
readonly score: 10;
|
|
111
|
+
readonly userReportReasons: readonly [];
|
|
112
|
+
readonly modReportReasons: readonly [];
|
|
113
|
+
readonly url: "https://www.reddit.com/r/test/comments/123/test_post/comment";
|
|
114
|
+
readonly ignoringReports: false;
|
|
115
|
+
};
|
|
116
|
+
export declare const mockUser: {
|
|
117
|
+
readonly id: "t2_123";
|
|
118
|
+
readonly username: "testuser";
|
|
119
|
+
readonly createdAt: Date;
|
|
120
|
+
readonly linkKarma: 1000;
|
|
121
|
+
readonly commentKarma: 500;
|
|
122
|
+
readonly nsfw: false;
|
|
123
|
+
readonly isAdmin: false;
|
|
124
|
+
readonly modPermissions: Map<any, any>;
|
|
125
|
+
readonly url: "https://www.reddit.com/user/testuser";
|
|
126
|
+
readonly permalink: "/user/testuser";
|
|
127
|
+
readonly hasVerifiedEmail: true;
|
|
128
|
+
};
|
|
8
129
|
export declare const basicFormDefinition: Readonly<Form>;
|
|
9
130
|
export declare const complexFormDefinition: Readonly<Form>;
|
|
10
131
|
export declare const expectedShowFormMessage: (form: Readonly<Form>) => Effect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../../src/effects/helpers/test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../../src/effects/helpers/test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,0DAA0D,CAAC;AAEnG,OAAO,KAAK,EAAE,IAAI,EAA4C,MAAM,iBAAiB,CAAC;AAItF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDhB,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCX,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAYX,CAAC;AAIX,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,IAAI,CAY9C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,IAAI,CA2BhD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAG,MAyF7D,CAAC"}
|
|
@@ -65,7 +65,7 @@ if (typeof addEventListener === 'function') {
|
|
|
65
65
|
if (type !== 'devvit-message') {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
if (!data
|
|
68
|
+
if (!data?.immersiveModeEvent) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
const immersiveMode = event.data.data?.immersiveModeEvent?.immersiveMode;
|
package/effects/navigate-to.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { Comment, Post, Subreddit, User } from '@devvit/reddit';
|
|
2
1
|
/**
|
|
3
2
|
* Navigates to a URL, subreddit, post, comment, or user.
|
|
4
3
|
*
|
|
5
4
|
* @param thingOrUrl - The URL, subreddit, post, comment, or user to navigate to
|
|
6
5
|
*/
|
|
7
|
-
export declare function navigateTo(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare function navigateTo(comment: Readonly<Comment>): void;
|
|
11
|
-
export declare function navigateTo(user: Readonly<User>): void;
|
|
6
|
+
export declare function navigateTo(thingOrUrl: string | {
|
|
7
|
+
readonly url: string;
|
|
8
|
+
}): void;
|
|
12
9
|
//# sourceMappingURL=navigate-to.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigate-to.d.ts","sourceRoot":"","sources":["../../src/effects/navigate-to.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigate-to.d.ts","sourceRoot":"","sources":["../../src/effects/navigate-to.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAY9E"}
|
package/effects/navigate-to.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { emitEffect } from '@devvit/shared-types/client/emit-effect.js';
|
|
2
|
+
/**
|
|
3
|
+
* Navigates to a URL, subreddit, post, comment, or user.
|
|
4
|
+
*
|
|
5
|
+
* @param thingOrUrl - The URL, subreddit, post, comment, or user to navigate to
|
|
6
|
+
*/
|
|
2
7
|
export function navigateTo(thingOrUrl) {
|
|
3
8
|
const inputUrl = typeof thingOrUrl === 'string' ? thingOrUrl : thingOrUrl.url;
|
|
4
9
|
if (!URL.canParse(inputUrl)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/client",
|
|
3
|
-
"version": "0.12.1-next-2025-08-
|
|
3
|
+
"version": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,16 +32,15 @@
|
|
|
32
32
|
},
|
|
33
33
|
"types": "./dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@devvit/protos": "0.12.1-next-2025-08-
|
|
36
|
-
"@devvit/
|
|
37
|
-
"@devvit/shared": "0.12.1-next-2025-08-
|
|
38
|
-
"@devvit/
|
|
39
|
-
"@devvit/web-view-scripts": "0.12.1-next-2025-08-25-20-31-24-ed3784f8b.0"
|
|
35
|
+
"@devvit/protos": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
36
|
+
"@devvit/shared": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
37
|
+
"@devvit/shared-types": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
38
|
+
"@devvit/web-view-scripts": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@ampproject/filesize": "4.3.0",
|
|
43
|
-
"@devvit/repo-tools": "0.12.1-next-2025-08-
|
|
44
|
-
"@devvit/tsconfig": "0.12.1-next-2025-08-
|
|
42
|
+
"@devvit/repo-tools": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
43
|
+
"@devvit/tsconfig": "0.12.1-next-2025-08-26-17-18-36-3b47afc7a.0",
|
|
45
44
|
"esbuild": "0.23.0",
|
|
46
45
|
"eslint": "9.11.1",
|
|
47
46
|
"typescript": "5.8.3",
|
|
@@ -49,10 +48,10 @@
|
|
|
49
48
|
},
|
|
50
49
|
"filesize": {
|
|
51
50
|
"dist/client.min.js": {
|
|
52
|
-
"gzip": "
|
|
53
|
-
"none": "
|
|
51
|
+
"gzip": "23 KB",
|
|
52
|
+
"none": "102 KB"
|
|
54
53
|
}
|
|
55
54
|
},
|
|
56
55
|
"source": "./src/index.ts",
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "fe6573873e4ecd6ce0f9a7fa2a3264fedab32ede"
|
|
58
57
|
}
|