@ifunny/ifunny-api-types 1.2.0 → 1.2.2
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/.devenv/bootstrap/bootstrapLib.nix +21 -1
- package/.devenv/bootstrap/lock-sources.nix +123 -0
- package/.devenv/bootstrap/resolve-input-paths.nix +34 -0
- package/.devenv/bootstrap/resolve-lock.nix +5 -79
- package/.devenv/changelog-cache.json +7 -3
- package/.devenv/devenv.fish +13 -13
- package/.devenv/input-paths.txt +2 -4
- package/.devenv/nix-eval-cache.db +0 -0
- package/.devenv/shell-env.sh +1601 -1589
- package/.devenv/state/files.json +5 -1
- package/.devenv/state/git-hooks-install/hooks +1 -0
- package/.devenv/state/git-hooks-install/key +4 -0
- package/.devenv/state/prek/.lock +0 -0
- package/.devenv/state/prek/README +2 -0
- package/.devenv/state/prek/config-tracking.json +3 -0
- package/.devenv/state/prek/patches/1793595918715-562072.patch +26 -0
- package/.devenv/state/prek/patches/1793596283854-574354.patch +22881 -0
- package/.devenv/state/prek/patches/1793596332255-574728.patch +22870 -0
- package/.devenv/state/prek/patches/1793597557669-617911.patch +284 -0
- package/.devenv/state/prek/patches/1793856046749-331249.patch +2906 -0
- package/.devenv/state/prek/patches/1793856096552-331868.patch +2998 -0
- package/.devenv/state/prek/patches/1793856146786-332328.patch +3009 -0
- package/.devenv/state/prek/patches/1793856181490-332981.patch +11401 -0
- package/.devenv/state/prek/patches/1793856203087-333510.patch +11388 -0
- package/.devenv/state/prek/patches/1793856277935-334258.patch +11372 -0
- package/.devenv/state/prek/patches/1793856646955-337912.patch +8488 -0
- package/.devenv/state/prek/patches/1793856682905-338572.patch +8260 -0
- package/.devenv/state/prek/patches/1793857035751-356215.patch +8295 -0
- package/.devenv/state/tasks.db +0 -0
- package/.devenv/task-names.txt +3 -1
- package/.prettierignore +9 -0
- package/CHANGELOG.md +476 -8272
- package/devenv.lock +47 -9
- package/devenv.nix +10 -13
- package/devenv.yaml +5 -0
- package/dist/errors/bad_request.js +8 -0
- package/dist/errors/bad_request.js.map +1 -0
- package/dist/errors/captcha_required.js +19 -0
- package/dist/errors/captcha_required.js.map +1 -0
- package/dist/errors/email_exists.js +8 -0
- package/dist/errors/email_exists.js.map +1 -0
- package/dist/errors/error.js +3 -0
- package/dist/errors/error.js.map +1 -0
- package/dist/errors/error_base.js +43 -0
- package/dist/errors/error_base.js.map +1 -0
- package/dist/errors/index.js +29 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/invalid_client.js +8 -0
- package/dist/errors/invalid_client.js.map +1 -0
- package/dist/errors/invalid_email.js +8 -0
- package/dist/errors/invalid_email.js.map +1 -0
- package/dist/errors/invalid_grant.js +8 -0
- package/dist/errors/invalid_grant.js.map +1 -0
- package/dist/errors/not_found.js +3 -0
- package/dist/errors/not_found.js.map +1 -0
- package/dist/errors/permission_denied.js +8 -0
- package/dist/errors/permission_denied.js.map +1 -0
- package/dist/errors/unauthorized.js +8 -0
- package/dist/errors/unauthorized.js.map +1 -0
- package/dist/errors/wrong_params.js +8 -0
- package/dist/errors/wrong_params.js.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/payloads/activity.js +50 -0
- package/dist/payloads/activity.js.map +1 -0
- package/dist/payloads/app.js +3 -0
- package/dist/payloads/app.js.map +1 -0
- package/dist/payloads/appeal.js +14 -0
- package/dist/payloads/appeal.js.map +1 -0
- package/dist/payloads/ban.js +36 -0
- package/dist/payloads/ban.js.map +1 -0
- package/dist/payloads/base.js +3 -0
- package/dist/payloads/base.js.map +1 -0
- package/dist/payloads/chat.js +37 -0
- package/dist/payloads/chat.js.map +1 -0
- package/dist/payloads/client.js +13 -0
- package/dist/payloads/client.js.map +1 -0
- package/dist/payloads/comment.js +42 -0
- package/dist/payloads/comment.js.map +1 -0
- package/dist/payloads/content.js +176 -0
- package/dist/payloads/content.js.map +1 -0
- package/dist/payloads/index.js +29 -0
- package/dist/payloads/index.js.map +1 -0
- package/dist/payloads/strike.js +3 -0
- package/dist/payloads/strike.js.map +1 -0
- package/dist/payloads/topics.js +72 -0
- package/dist/payloads/topics.js.map +1 -0
- package/dist/payloads/user.js +215 -0
- package/dist/payloads/user.js.map +1 -0
- package/dist/rest/account.js +3 -0
- package/dist/rest/account.js.map +1 -0
- package/dist/rest/content.js +54 -0
- package/dist/rest/content.js.map +1 -0
- package/dist/rest/counters.js +3 -0
- package/dist/rest/counters.js.map +1 -0
- package/dist/rest/endpoints.js +199 -0
- package/dist/rest/endpoints.js.map +1 -0
- package/dist/rest/explore.js +82 -0
- package/dist/rest/explore.js.map +1 -0
- package/dist/rest/feeds.js +3 -0
- package/dist/rest/feeds.js.map +1 -0
- package/dist/rest/index.js +25 -0
- package/dist/rest/index.js.map +1 -0
- package/dist/rest/issues.js +3 -0
- package/dist/rest/issues.js.map +1 -0
- package/dist/rest/oauth2.js +9 -0
- package/dist/rest/oauth2.js.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rest.js +3 -0
- package/dist/utils/rest.js.map +1 -0
- package/dist/utils/util.js +3 -0
- package/dist/utils/util.js.map +1 -0
- package/package.json +15 -8
- package/tag-check.sh +111 -0
- package/types/errors/bad_request.d.ts +12 -0
- package/types/errors/bad_request.d.ts.map +1 -0
- package/types/errors/captcha_required.d.ts +33 -0
- package/types/errors/captcha_required.d.ts.map +1 -0
- package/types/errors/email_exists.d.ts +15 -0
- package/types/errors/email_exists.d.ts.map +1 -0
- package/types/errors/error.d.ts +29 -0
- package/types/errors/error.d.ts.map +1 -0
- package/types/errors/error_base.d.ts +61 -0
- package/types/errors/error_base.d.ts.map +1 -0
- package/types/errors/index.d.ts +13 -0
- package/types/errors/index.d.ts.map +1 -0
- package/types/errors/invalid_client.d.ts +15 -0
- package/types/errors/invalid_client.d.ts.map +1 -0
- package/types/errors/invalid_email.d.ts +15 -0
- package/types/errors/invalid_email.d.ts.map +1 -0
- package/types/errors/invalid_grant.d.ts +12 -0
- package/types/errors/invalid_grant.d.ts.map +1 -0
- package/types/errors/not_found.d.ts +8 -0
- package/types/errors/not_found.d.ts.map +1 -0
- package/types/errors/permission_denied.d.ts +12 -0
- package/types/errors/permission_denied.d.ts.map +1 -0
- package/types/errors/unauthorized.d.ts +12 -0
- package/types/errors/unauthorized.d.ts.map +1 -0
- package/types/errors/wrong_params.d.ts +11 -0
- package/types/errors/wrong_params.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/payloads/activity.d.ts +114 -0
- package/types/payloads/activity.d.ts.map +1 -0
- package/types/payloads/app.d.ts +266 -0
- package/types/payloads/app.d.ts.map +1 -0
- package/types/payloads/appeal.d.ts +22 -0
- package/types/payloads/appeal.d.ts.map +1 -0
- package/types/payloads/ban.d.ts +85 -0
- package/types/payloads/ban.d.ts.map +1 -0
- package/types/payloads/base.d.ts +5 -0
- package/types/payloads/base.d.ts.map +1 -0
- package/types/payloads/chat.d.ts +117 -0
- package/types/payloads/chat.d.ts.map +1 -0
- package/types/payloads/client.d.ts +108 -0
- package/types/payloads/client.d.ts.map +1 -0
- package/types/payloads/comment.d.ts +124 -0
- package/types/payloads/comment.d.ts.map +1 -0
- package/types/payloads/content.d.ts +677 -0
- package/types/payloads/content.d.ts.map +1 -0
- package/types/payloads/index.d.ts +13 -0
- package/types/payloads/index.d.ts.map +1 -0
- package/types/payloads/strike.d.ts +15 -0
- package/types/payloads/strike.d.ts.map +1 -0
- package/types/payloads/topics.d.ts +45 -0
- package/types/payloads/topics.d.ts.map +1 -0
- package/types/payloads/user.d.ts +523 -0
- package/types/payloads/user.d.ts.map +1 -0
- package/types/rest/account.d.ts +4 -0
- package/types/rest/account.d.ts.map +1 -0
- package/types/rest/content.d.ts +96 -0
- package/types/rest/content.d.ts.map +1 -0
- package/types/rest/counters.d.ts +10 -0
- package/types/rest/counters.d.ts.map +1 -0
- package/types/rest/endpoints.d.ts +153 -0
- package/types/rest/endpoints.d.ts.map +1 -0
- package/types/rest/explore.d.ts +113 -0
- package/types/rest/explore.d.ts.map +1 -0
- package/types/rest/feeds.d.ts +17 -0
- package/types/rest/feeds.d.ts.map +1 -0
- package/types/rest/index.d.ts +9 -0
- package/types/rest/index.d.ts.map +1 -0
- package/types/rest/issues.d.ts +16 -0
- package/types/rest/issues.d.ts.map +1 -0
- package/types/rest/oauth2.d.ts +37 -0
- package/types/rest/oauth2.d.ts.map +1 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/rest.d.ts +50 -0
- package/types/utils/rest.d.ts.map +1 -0
- package/types/utils/util.d.ts +80 -0
- package/types/utils/util.d.ts.map +1 -0
- package/.devenv/nix-eval-cache.db-shm +0 -0
- package/.devenv/nix-eval-cache.db-wal +0 -0
- package/.devenv/state/tasks.db-shm +0 -0
- package/.devenv/state/tasks.db-wal +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Endpoints = void 0;
|
|
5
|
+
class Endpoints {
|
|
6
|
+
/**
|
|
7
|
+
* @param query The nick or id of the user
|
|
8
|
+
* @param byNick Whether to fetch by nick (Default: false)
|
|
9
|
+
* @example
|
|
10
|
+
* "/timelines/users/:userId"
|
|
11
|
+
* "/timelines/users/by_nick/:userNick"
|
|
12
|
+
*/
|
|
13
|
+
static userTimeline(query, byNick = false) {
|
|
14
|
+
return this.timelines + this.user(query, byNick);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @param query The user id or nick
|
|
18
|
+
* @param byNick Whether to fetch by nick (Default: false)
|
|
19
|
+
* @example
|
|
20
|
+
* "/users"
|
|
21
|
+
* "/users/:userId"
|
|
22
|
+
* "/users/by_nick/:userNick"
|
|
23
|
+
*/
|
|
24
|
+
static user(query, byNick = false) {
|
|
25
|
+
const users = "/users";
|
|
26
|
+
if (!query)
|
|
27
|
+
return users;
|
|
28
|
+
return users + (byNick ? `/by_nick/${query}` : `/${query}`);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @param user The user id or nick
|
|
32
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
33
|
+
* @example
|
|
34
|
+
* "/users/:userId/guests"
|
|
35
|
+
* "/users/by_nick/:userNick/guests"
|
|
36
|
+
*/
|
|
37
|
+
static guests(user, byNick = false) {
|
|
38
|
+
return this.user(user, byNick) + "/guests";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param user The user id or nick
|
|
42
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
43
|
+
* @example
|
|
44
|
+
* "/users/:userId/blocked"
|
|
45
|
+
* "/users/by_nick/:userNick/blocked"
|
|
46
|
+
*/
|
|
47
|
+
static blocked(user, byNick = false) {
|
|
48
|
+
return this.user(user, byNick) + "/blocked";
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param user User nick or ID
|
|
53
|
+
* @param byNick User is the nick
|
|
54
|
+
* @example
|
|
55
|
+
* ""
|
|
56
|
+
*/
|
|
57
|
+
static blockedData(user, byNick = false) {
|
|
58
|
+
return this.blocked(user, byNick) + "/data";
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param user Url to block
|
|
63
|
+
* @param byNick Is the user the nick?
|
|
64
|
+
* @example
|
|
65
|
+
* "/users/my/blocked/:userId"
|
|
66
|
+
* "/users/my/blocked/by_nick/:userNick"
|
|
67
|
+
*/
|
|
68
|
+
static blockUser(user, byNick = false) {
|
|
69
|
+
return this.myUser + "/blocked" + this.user(user, byNick);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param user The user id or nick
|
|
73
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
74
|
+
* @example
|
|
75
|
+
* "/users/:userId/subscribers"
|
|
76
|
+
* "/users/by_nick/:userNick/subscribers"
|
|
77
|
+
*/
|
|
78
|
+
static subscribers(user, byNick = false) {
|
|
79
|
+
return this.user(user, byNick) + "/subscribers";
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param user The user id or nick
|
|
83
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
84
|
+
* @example
|
|
85
|
+
* "/users/:userId/subscriptions"
|
|
86
|
+
*/
|
|
87
|
+
static subscriptions(user, byNick = false) {
|
|
88
|
+
return this.user(user, byNick) + "/subscriptions";
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @param id Id of the content if getting one
|
|
92
|
+
* @example
|
|
93
|
+
* "/content"
|
|
94
|
+
* "/content/:contentId"
|
|
95
|
+
*/
|
|
96
|
+
static content(id) {
|
|
97
|
+
return "/content" + (id ? `/${id}` : "");
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @param contentId The content id
|
|
101
|
+
* @example
|
|
102
|
+
* "/content/:contentId/smiles"
|
|
103
|
+
*/
|
|
104
|
+
static smiles(contentId) {
|
|
105
|
+
return this.content(contentId) + "/smiles";
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @param contentId The content id
|
|
109
|
+
* @example
|
|
110
|
+
* "/content/:contentId/unsmiles"
|
|
111
|
+
*/
|
|
112
|
+
static unsmiles(contentId) {
|
|
113
|
+
return this.content(contentId) + "/unsmiles";
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @param contentId The content id
|
|
117
|
+
* @example
|
|
118
|
+
* "/content/:contentId/republished"
|
|
119
|
+
*/
|
|
120
|
+
static republishes(contentId) {
|
|
121
|
+
return this.content(contentId) + "/republished";
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @param contentId Id of the content
|
|
125
|
+
* @param commentId Id of the comment if applicable
|
|
126
|
+
* @example
|
|
127
|
+
* "/content/:contentId/comments"
|
|
128
|
+
* "/content/:contentId/comments/:commentId"
|
|
129
|
+
*/
|
|
130
|
+
static comments(contentId, commentId) {
|
|
131
|
+
return this.content(contentId) + "/comments" + (commentId ? `/${commentId}` : "");
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @param contentId The content id
|
|
135
|
+
* @param commentId The comment id
|
|
136
|
+
* @example
|
|
137
|
+
* "/content/:contentId/comments/:commentId/replies"
|
|
138
|
+
*/
|
|
139
|
+
static replies(contentId, commentId) {
|
|
140
|
+
return this.comments(contentId, commentId) + "/replies";
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @param contentId The content id
|
|
144
|
+
* @example
|
|
145
|
+
* "/content/:contentId/comments/attached_content"
|
|
146
|
+
*/
|
|
147
|
+
static commentAttachment(contentId) {
|
|
148
|
+
return this.comments(contentId) + "/attached_content";
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
152
|
+
* @example
|
|
153
|
+
* "/reads"
|
|
154
|
+
* "/reads/:contentId"
|
|
155
|
+
* "/reads/:contentId1,contentId2..."
|
|
156
|
+
*/
|
|
157
|
+
static reads(contentId) {
|
|
158
|
+
if (Array.isArray(contentId)) {
|
|
159
|
+
contentId = contentId.join(",");
|
|
160
|
+
}
|
|
161
|
+
return "/reads" + (contentId ? `/${contentId}` : "");
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @param userId The id of the user the ban belongs to
|
|
165
|
+
* @param banId The id of the Ban
|
|
166
|
+
* @example
|
|
167
|
+
* "/users/:userId/bans"
|
|
168
|
+
* "/users/:userId/bans/:banId"
|
|
169
|
+
*/
|
|
170
|
+
static bans(userId, banId) {
|
|
171
|
+
return `/users/${userId}/bans` + (banId ? `/${banId}` : "");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.Endpoints = Endpoints;
|
|
175
|
+
_a = Endpoints;
|
|
176
|
+
Endpoints.base = "api.ifunny.mobi";
|
|
177
|
+
Endpoints.account = "/account";
|
|
178
|
+
Endpoints.collective = "/feeds/collective";
|
|
179
|
+
Endpoints.counters = "/counters";
|
|
180
|
+
Endpoints.featured = "/feeds/featured";
|
|
181
|
+
Endpoints.feeds = "/feeds";
|
|
182
|
+
Endpoints.oauth2 = "/oauth2";
|
|
183
|
+
Endpoints.projectElements = "/feeds/project_elements";
|
|
184
|
+
Endpoints.subscriptionFeed = "/timelines/home";
|
|
185
|
+
Endpoints.timelines = "/timelines";
|
|
186
|
+
Endpoints.token = "/oauth2/token";
|
|
187
|
+
Endpoints.myUser = "/users/my";
|
|
188
|
+
Endpoints.myComments = _a.myUser + "/comments";
|
|
189
|
+
Endpoints.chatInvites = _a.myUser + "/chat_invitations";
|
|
190
|
+
Endpoints.mySmiles = _a.myUser + "/content_smiles";
|
|
191
|
+
Endpoints.myAppeals = _a.myUser + "/appeals";
|
|
192
|
+
Endpoints.unreadChatMessages = _a.myUser + "/unread_chat_messages";
|
|
193
|
+
Endpoints.myNews = "/news/my";
|
|
194
|
+
Endpoints.nicksAvailable = "/users/nicks_available";
|
|
195
|
+
Endpoints.emailsAvailable = "/users/emails_available";
|
|
196
|
+
Endpoints.app = "/app";
|
|
197
|
+
Endpoints.settings = _a.app + "/settings";
|
|
198
|
+
Endpoints.privacy = _a.app + "/privacy";
|
|
199
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/rest/endpoints.ts"],"names":[],"mappings":";;;;AAAA,MAAa,SAAS;IAyBrB;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,KAAa,EAAE,SAAkB,KAAK;QACzD,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,KAAc,EAAE,SAAkB,KAAK;QAClD,MAAM,KAAK,GAAG,QAAQ,CAAC;QACvB,IAAI,CAAC,KAAK;YAAE,OAA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,GAAG,MAAM,AAAT,CAAU;AACb,kBAAQ,GAAG,EAAI,CAAC,GAAG,GAAG,WAAW,AAAzB,CAA0B;AAClC,iBAAO,GAAG,EAAI,CAAC,GAAG,GAAG,UAAU,AAAxB,CAAyB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXPLORE_COMPILATION_TYPES = exports.EXPLORE_COMPILATION_IDS = exports.EXPLORE_LAYOUTS = exports.EXPLORE_TAB_IDS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* All known explore tab ids
|
|
6
|
+
*/
|
|
7
|
+
var EXPLORE_TAB_IDS;
|
|
8
|
+
(function (EXPLORE_TAB_IDS) {
|
|
9
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Best"] = 2] = "Best";
|
|
10
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Memes"] = 3] = "Memes";
|
|
11
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Users"] = 4] = "Users";
|
|
12
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Chats"] = 5] = "Chats";
|
|
13
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Channels"] = 6] = "Channels";
|
|
14
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["Tags"] = 7] = "Tags";
|
|
15
|
+
EXPLORE_TAB_IDS[EXPLORE_TAB_IDS["All"] = 8] = "All";
|
|
16
|
+
})(EXPLORE_TAB_IDS || (exports.EXPLORE_TAB_IDS = EXPLORE_TAB_IDS = {}));
|
|
17
|
+
/**
|
|
18
|
+
* All possible layouts for explore
|
|
19
|
+
*/
|
|
20
|
+
var EXPLORE_LAYOUTS;
|
|
21
|
+
(function (EXPLORE_LAYOUTS) {
|
|
22
|
+
/**
|
|
23
|
+
* Lists content in explore
|
|
24
|
+
*/
|
|
25
|
+
EXPLORE_LAYOUTS["CONTENT_LIST"] = "content_list_6_items";
|
|
26
|
+
/**
|
|
27
|
+
* Lists comments in explore
|
|
28
|
+
*/
|
|
29
|
+
EXPLORE_LAYOUTS["COMMENT_LIST"] = "comment_list";
|
|
30
|
+
/**
|
|
31
|
+
* Lists chats in explore
|
|
32
|
+
*/
|
|
33
|
+
EXPLORE_LAYOUTS["CHATS_LIST"] = "chats_list_horizontal";
|
|
34
|
+
/**
|
|
35
|
+
* Lists users in explore
|
|
36
|
+
*/
|
|
37
|
+
EXPLORE_LAYOUTS["USER_LIST"] = "users_list_vertical";
|
|
38
|
+
/**
|
|
39
|
+
* Lists categories in explore
|
|
40
|
+
*/
|
|
41
|
+
EXPLORE_LAYOUTS["CATEGORY_LIST"] = "category_list";
|
|
42
|
+
/**
|
|
43
|
+
* Lists top values by their calender year or month
|
|
44
|
+
*/
|
|
45
|
+
EXPLORE_LAYOUTS["CALENDER_LIST"] = "calender";
|
|
46
|
+
})(EXPLORE_LAYOUTS || (exports.EXPLORE_LAYOUTS = EXPLORE_LAYOUTS = {}));
|
|
47
|
+
// TODO: Document all compilation ids
|
|
48
|
+
var EXPLORE_COMPILATION_IDS;
|
|
49
|
+
(function (EXPLORE_COMPILATION_IDS) {
|
|
50
|
+
EXPLORE_COMPILATION_IDS["CONTENT_TOP_OVERALL"] = "content_top_overall";
|
|
51
|
+
EXPLORE_COMPILATION_IDS["CONTENT_TOP_TODAY"] = "content_top_today";
|
|
52
|
+
EXPLORE_COMPILATION_IDS["CONTENT_TOP_SHARES"] = "content_top_by_share";
|
|
53
|
+
EXPLORE_COMPILATION_IDS["CONTENT_SHUFFLE"] = "content_shuffle";
|
|
54
|
+
EXPLORE_COMPILATION_IDS["USERS_TOP_OVERALL"] = "users_top_overall";
|
|
55
|
+
EXPLORE_COMPILATION_IDS["USER_TOP_FEATURED"] = "users_top_by_featured";
|
|
56
|
+
EXPLORE_COMPILATION_IDS["USER_TOP_SUBSCRIBERS"] = "users_top_by_subcribers";
|
|
57
|
+
EXPLORE_COMPILATION_IDS["USER_TOP_VIEWS"] = "users_top_by_content_views";
|
|
58
|
+
EXPLORE_COMPILATION_IDS["CHATS_POPULAR_LAST_WEEK"] = "chats_popular_last_week";
|
|
59
|
+
EXPLORE_COMPILATION_IDS["CHATS_NEW"] = "chats_new_chats";
|
|
60
|
+
EXPLORE_COMPILATION_IDS["CHATS_TOP_MEMBERS"] = "chats_top_by_members";
|
|
61
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_COMMUNITY_GAMING"] = "channel-community-gaming";
|
|
62
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_WTF"] = "channel-wtf";
|
|
63
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_ANIMALS"] = "channel-animals";
|
|
64
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_GAMES"] = "channel-games";
|
|
65
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_COMICS"] = "channel-comics";
|
|
66
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_SPORTS"] = "channel-sports";
|
|
67
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_VIDEO"] = "channel-video";
|
|
68
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_ORIGINALS"] = "channel-ifunny-originals";
|
|
69
|
+
EXPLORE_COMPILATION_IDS["CHANNEL_WHOLESOME"] = "channel-wholesome-wednesday";
|
|
70
|
+
EXPLORE_COMPILATION_IDS["CALENDER_BY_YEARS"] = "calender_by_years";
|
|
71
|
+
EXPLORE_COMPILATION_IDS["CALENDER_BY_MONTH"] = "calender_by_month";
|
|
72
|
+
})(EXPLORE_COMPILATION_IDS || (exports.EXPLORE_COMPILATION_IDS = EXPLORE_COMPILATION_IDS = {}));
|
|
73
|
+
var EXPLORE_COMPILATION_TYPES;
|
|
74
|
+
(function (EXPLORE_COMPILATION_TYPES) {
|
|
75
|
+
EXPLORE_COMPILATION_TYPES["CONTENT"] = "content";
|
|
76
|
+
EXPLORE_COMPILATION_TYPES["CALENDER"] = "calender";
|
|
77
|
+
EXPLORE_COMPILATION_TYPES["CHAT"] = "chat";
|
|
78
|
+
EXPLORE_COMPILATION_TYPES["CATEGORY"] = "category";
|
|
79
|
+
EXPLORE_COMPILATION_TYPES["USER"] = "user";
|
|
80
|
+
EXPLORE_COMPILATION_TYPES["COMMENT"] = "comment";
|
|
81
|
+
})(EXPLORE_COMPILATION_TYPES || (exports.EXPLORE_COMPILATION_TYPES = EXPLORE_COMPILATION_TYPES = {}));
|
|
82
|
+
//# sourceMappingURL=explore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../src/rest/explore.ts"],"names":[],"mappings":";;;AA0BA;;GAEG;AACH,IAAY,eAQX;AARD,WAAY,eAAe;IAC1B,qDAAQ,CAAA;IACR,uDAAS,CAAA;IACT,uDAAS,CAAA;IACT,uDAAS,CAAA;IACT,6DAAY,CAAA;IACZ,qDAAQ,CAAA;IACR,mDAAO,CAAA;AACR,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAWD;;GAEG;AACH,IAAY,eAyBX;AAzBD,WAAY,eAAe;IAC1B;;OAEG;IACH,wDAAqC,CAAA;IACrC;;OAEG;IACH,gDAA6B,CAAA;IAC7B;;OAEG;IACH,uDAAoC,CAAA;IACpC;;OAEG;IACH,oDAAiC,CAAA;IACjC;;OAEG;IACH,kDAA+B,CAAA;IAC/B;;OAEG;IACH,6CAA0B,CAAA;AAC3B,CAAC,EAzBW,eAAe,+BAAf,eAAe,QAyB1B;AAiBD,qCAAqC;AACrC,IAAY,uBAuBX;AAvBD,WAAY,uBAAuB;IAClC,sEAA2C,CAAA;IAC3C,kEAAuC,CAAA;IACvC,sEAA2C,CAAA;IAC3C,8DAAmC,CAAA;IACnC,kEAAuC,CAAA;IACvC,sEAA2C,CAAA;IAC3C,2EAAgD,CAAA;IAChD,wEAA6C,CAAA;IAC7C,8EAAmD,CAAA;IACnD,wDAA6B,CAAA;IAC7B,qEAA0C,CAAA;IAC1C,gFAAqD,CAAA;IACrD,sDAA2B,CAAA;IAC3B,8DAAmC,CAAA;IACnC,0DAA+B,CAAA;IAC/B,4DAAiC,CAAA;IACjC,4DAAiC,CAAA;IACjC,0DAA+B,CAAA;IAC/B,yEAA8C,CAAA;IAC9C,4EAAiD,CAAA;IACjD,kEAAuC,CAAA;IACvC,kEAAuC,CAAA;AACxC,CAAC,EAvBW,uBAAuB,uCAAvB,uBAAuB,QAuBlC;AAID,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACpC,gDAAmB,CAAA;IACnB,kDAAqB,CAAA;IACrB,0CAAa,CAAA;IACb,kDAAqB,CAAA;IACrB,0CAAa,CAAA;IACb,gDAAmB,CAAA;AACpB,CAAC,EAPW,yBAAyB,yCAAzB,yBAAyB,QAOpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feeds.js","sourceRoot":"","sources":["../../src/rest/feeds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./account"), exports);
|
|
18
|
+
__exportStar(require("./content"), exports);
|
|
19
|
+
__exportStar(require("./counters"), exports);
|
|
20
|
+
__exportStar(require("./endpoints"), exports);
|
|
21
|
+
__exportStar(require("./explore"), exports);
|
|
22
|
+
__exportStar(require("./feeds"), exports);
|
|
23
|
+
__exportStar(require("./issues"), exports);
|
|
24
|
+
__exportStar(require("./oauth2"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/rest/issues.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOKEN_TYPES = void 0;
|
|
4
|
+
var TOKEN_TYPES;
|
|
5
|
+
(function (TOKEN_TYPES) {
|
|
6
|
+
TOKEN_TYPES["BEARER"] = "bearer";
|
|
7
|
+
TOKEN_TYPES["BASIC"] = "basic";
|
|
8
|
+
})(TOKEN_TYPES || (exports.TOKEN_TYPES = TOKEN_TYPES = {}));
|
|
9
|
+
//# sourceMappingURL=oauth2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2.js","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":";;;AAqBA,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AAChB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rest"), exports);
|
|
18
|
+
__exportStar(require("./util"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/utils/rest.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifunny/ifunny-api-types",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "iFunny API typings for use in bot library creaion.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "types",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@eslint/js": "^9.23.0",
|
|
39
39
|
"@types/node": "22.13.14",
|
|
40
|
-
"auto-changelog": "2.
|
|
41
|
-
"eslint": "^9.
|
|
40
|
+
"auto-changelog": "^2.7.0",
|
|
41
|
+
"eslint": "^9.39.5",
|
|
42
42
|
"globals": "^16.0.0",
|
|
43
43
|
"prettier": "^3.5.3",
|
|
44
|
-
"typescript": "
|
|
44
|
+
"typescript": "~6.0.3",
|
|
45
45
|
"typescript-eslint": "^8.28.0"
|
|
46
46
|
},
|
|
47
47
|
"auto-changelog": {
|
|
@@ -49,11 +49,18 @@
|
|
|
49
49
|
"hideEmptyReleases": true,
|
|
50
50
|
"commitLimit": false,
|
|
51
51
|
"unreleased": true,
|
|
52
|
+
"tagPrefix": "v",
|
|
52
53
|
"replaceText": {
|
|
53
|
-
"[
|
|
54
|
-
"[
|
|
55
|
-
"[
|
|
56
|
-
"[
|
|
54
|
+
"([bB]reaking:\\s*)": "",
|
|
55
|
+
"([bB]reaking change:\\s*)": "",
|
|
56
|
+
"(^[fF]eat:\\s*)": "",
|
|
57
|
+
"(^[fF]ix:\\s*)": "",
|
|
58
|
+
"(^[cC]hore:\\s*)": "",
|
|
59
|
+
"(^[dD]ocs?:\\s*)": "",
|
|
60
|
+
"(^[rR]efactor:\\s*)": "",
|
|
61
|
+
"(^[tT]est:\\s*)": "",
|
|
62
|
+
"(^[sS]tyle:\\s*)": "",
|
|
63
|
+
"(^[pP]erf:\\s*)": ""
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
}
|
package/tag-check.sh
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
function pkgver
|
|
2
|
+
git show $argv[1] 2>/dev/null | node -e 'try{process.stdout.write(String(JSON.parse(require("fs").readFileSync(0,"utf8")).version||""))}catch(e){}'
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
function tagcheck
|
|
6
|
+
argparse n/dry-run 's/skip=+' -- $argv; or return 1
|
|
7
|
+
|
|
8
|
+
set -l key (git config user.signingkey)
|
|
9
|
+
if not set -q _flag_dry_run; and test -z "$key"
|
|
10
|
+
echo "No user.signingkey configured. Set one first, or run: tagcheck --dry-run"
|
|
11
|
+
return 1
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
set -l seen
|
|
15
|
+
set -l created
|
|
16
|
+
set -l fixed
|
|
17
|
+
set -l n_ok 0
|
|
18
|
+
set -l n_skip 0
|
|
19
|
+
|
|
20
|
+
for c in (git log --reverse --format=%H -G'^[[:space:]]*"version"[[:space:]]*:' -- package.json)
|
|
21
|
+
set -l new (pkgver $c:package.json)
|
|
22
|
+
set -l old (pkgver $c^:package.json)
|
|
23
|
+
test -z "$new"; and continue
|
|
24
|
+
test "$old" = "$new"; and continue
|
|
25
|
+
|
|
26
|
+
set -l tag "v$new"
|
|
27
|
+
set -l short (git log -1 --format=%h $c)
|
|
28
|
+
|
|
29
|
+
if contains -- $new $seen
|
|
30
|
+
echo "WARN $tag version set again at $short (was $old), skipping"
|
|
31
|
+
continue
|
|
32
|
+
end
|
|
33
|
+
set -a seen $new
|
|
34
|
+
|
|
35
|
+
set -l date (git log -1 --format=%cI $c)
|
|
36
|
+
set -l msg "Release $tag"
|
|
37
|
+
set -l action ""
|
|
38
|
+
|
|
39
|
+
if git rev-parse -q --verify "refs/tags/$tag" >/dev/null
|
|
40
|
+
set -l problems
|
|
41
|
+
set -l target (git rev-list -n1 $tag)
|
|
42
|
+
|
|
43
|
+
if test "$target" != "$c"
|
|
44
|
+
set -a problems "points at "(git log -1 --format=%h $target)", expected $short"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if test (git cat-file -t $tag) != tag
|
|
48
|
+
set -a problems "lightweight"
|
|
49
|
+
else
|
|
50
|
+
if not git cat-file tag $tag | string match -rq 'BEGIN (PGP|SSH) SIGNATURE'
|
|
51
|
+
set -a problems "unsigned"
|
|
52
|
+
else if not git verify-tag $tag >/dev/null 2>&1
|
|
53
|
+
set -a problems "signature does not verify"
|
|
54
|
+
end
|
|
55
|
+
set -l subj (git tag -l --format='%(contents:subject)' $tag)
|
|
56
|
+
if test -z "$subj"
|
|
57
|
+
set -a problems "empty message"
|
|
58
|
+
else
|
|
59
|
+
set msg $subj
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
if test (count $problems) -eq 0
|
|
64
|
+
echo "OK $tag $short"
|
|
65
|
+
set n_ok (math $n_ok + 1)
|
|
66
|
+
continue
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if contains -- $tag $_flag_skip
|
|
70
|
+
echo "SKIP $tag $short "(string join "; " $problems)
|
|
71
|
+
set n_skip (math $n_skip + 1)
|
|
72
|
+
continue
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
set action fix
|
|
76
|
+
echo "BAD $tag $short "(string join "; " $problems)
|
|
77
|
+
else
|
|
78
|
+
set -l others (git tag --points-at $c)
|
|
79
|
+
test (count $others) -gt 0; and echo "NOTE $short already has other tag(s): $others"
|
|
80
|
+
set action create
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if set -q _flag_dry_run
|
|
84
|
+
test $action = fix; and echo "WOULD FIX $tag $short $msg"
|
|
85
|
+
test $action = create; and echo "WOULD CREATE $tag $short $msg"
|
|
86
|
+
else
|
|
87
|
+
set -l flags -s
|
|
88
|
+
test $action = fix; and set flags -s -f
|
|
89
|
+
env GIT_COMMITTER_DATE=$date git tag $flags $tag -m "$msg" $c
|
|
90
|
+
if test $status -ne 0
|
|
91
|
+
echo "FAIL $tag signing failed at $short, stopping"
|
|
92
|
+
return 1
|
|
93
|
+
end
|
|
94
|
+
test $action = fix; and echo "FIXED $tag $short $msg"
|
|
95
|
+
test $action = create; and echo "NEW $tag $short $msg"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
test $action = fix; and set -a fixed $tag
|
|
99
|
+
test $action = create; and set -a created $tag
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
set -l verb (set -q _flag_dry_run; and echo "to "; or echo "")
|
|
103
|
+
echo
|
|
104
|
+
echo "Summary: $n_ok ok, $n_skip skipped, "(count $fixed)" "$verb"fixed, "(count $created)" "$verb"created"
|
|
105
|
+
|
|
106
|
+
if not set -q _flag_dry_run
|
|
107
|
+
test (count $created) -gt 0; and echo "Push new: git push origin $created"
|
|
108
|
+
test (count $fixed) -gt 0; and echo "Push fixed: git push --force origin $fixed"
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
tagcheck
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
export interface RESTAPIErrorBadRequest extends RESTAPIError {
|
|
3
|
+
error: IFUNNY_ERRORS.BAD_REQUEST;
|
|
4
|
+
error_description: RESTAPIBadRequestMessage;
|
|
5
|
+
status: 400;
|
|
6
|
+
}
|
|
7
|
+
export default RESTAPIErrorBadRequest;
|
|
8
|
+
export declare enum BAD_REQUEST {
|
|
9
|
+
INVALID_USER_ID = "Invalid user id"
|
|
10
|
+
}
|
|
11
|
+
type RESTAPIBadRequestMessage = `${BAD_REQUEST}`;
|
|
12
|
+
//# sourceMappingURL=bad_request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad_request.d.ts","sourceRoot":"","sources":["../../src/errors/bad_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC3D,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC;IACjC,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,eAAe,sBAAsB,CAAC;AAEtC,oBAAY,WAAW;IACtB,eAAe,oBAAoB;CACnC;AAED,KAAK,wBAAwB,GAAG,GAAG,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
/**
|
|
3
|
+
* This is thrown when you need to solve a captcha to complete the request.
|
|
4
|
+
*/
|
|
5
|
+
export interface RESTAPIErrorCaptchaRequired extends RESTAPIError {
|
|
6
|
+
error: IFUNNY_ERRORS.CAPTCHA_REQUIRED;
|
|
7
|
+
error_description: RESTAPIErrorCaptchaRequiredMessage;
|
|
8
|
+
data: {
|
|
9
|
+
/**
|
|
10
|
+
* Open this url in any browser, solve it, then make the exact same request again.
|
|
11
|
+
*/
|
|
12
|
+
captcha_url: string;
|
|
13
|
+
type: RESTAPICaptchaType;
|
|
14
|
+
};
|
|
15
|
+
status: 403;
|
|
16
|
+
}
|
|
17
|
+
export default RESTAPIErrorCaptchaRequired;
|
|
18
|
+
/**
|
|
19
|
+
* Known error descriptions
|
|
20
|
+
*/
|
|
21
|
+
export declare enum CAPTCHA_REQUIRED {
|
|
22
|
+
VERIFY_HUMAN = "Human verification is required"
|
|
23
|
+
}
|
|
24
|
+
export type RESTAPIErrorCaptchaRequiredMessage = `${CAPTCHA_REQUIRED}`;
|
|
25
|
+
/**
|
|
26
|
+
* Known captcha types
|
|
27
|
+
*/
|
|
28
|
+
declare enum CAPTCHA_TYPE {
|
|
29
|
+
FUN_CAPTCHA = "fun_captcha",
|
|
30
|
+
RECAPTCHA = "recaptcha"
|
|
31
|
+
}
|
|
32
|
+
export type RESTAPICaptchaType = `${CAPTCHA_TYPE}`;
|
|
33
|
+
//# sourceMappingURL=captcha_required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captcha_required.d.ts","sourceRoot":"","sources":["../../src/errors/captcha_required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAChE,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;IACtC,iBAAiB,EAAE,kCAAkC,CAAC;IACtD,IAAI,EAAE;QACL;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,kBAAkB,CAAC;KACzB,CAAC;IACF,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,eAAe,2BAA2B,CAAC;AAE3C;;GAEG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,mCAAmC;CAC/C;AAED,MAAM,MAAM,kCAAkC,GAAG,GAAG,gBAAgB,EAAE,CAAC;AAEvE;;GAEG;AACH,aAAK,YAAY;IAChB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;CACvB;AAED,MAAM,MAAM,kBAAkB,GAAG,GAAG,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
/**
|
|
3
|
+
* Returned when trying to create an account with an email that's already taken
|
|
4
|
+
*/
|
|
5
|
+
export interface RESTAPIErrorEmailExists extends RESTAPIError {
|
|
6
|
+
error: IFUNNY_ERRORS.EMAIL_EXISTS;
|
|
7
|
+
error_description: RESTAPIErrorEmailExistsMessage;
|
|
8
|
+
status: 403;
|
|
9
|
+
}
|
|
10
|
+
export default RESTAPIErrorEmailExists;
|
|
11
|
+
export declare enum EMAIL_EXISTS_MESSAGE {
|
|
12
|
+
USER_WITH_EMAIL = "There is a user with this email"
|
|
13
|
+
}
|
|
14
|
+
export type RESTAPIErrorEmailExistsMessage = `${EMAIL_EXISTS_MESSAGE}`;
|
|
15
|
+
//# sourceMappingURL=email_exists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email_exists.d.ts","sourceRoot":"","sources":["../../src/errors/email_exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC5D,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC;IAClC,iBAAiB,EAAE,8BAA8B,CAAC;IAClD,MAAM,EAAE,GAAG,CAAC;CACZ;AACD,eAAe,uBAAuB,CAAC;AAEvC,oBAAY,oBAAoB;IAC/B,eAAe,oCAAoC;CACnD;AAED,MAAM,MAAM,8BAA8B,GAAG,GAAG,oBAAoB,EAAE,CAAC"}
|