@ifunny/ifunny-api-types 1.0.4 → 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 +650 -0
- package/.devenv/bootstrap/default.nix +22 -0
- package/.devenv/bootstrap/lock-sources.nix +123 -0
- package/.devenv/bootstrap/resolve-input-paths.nix +34 -0
- package/.devenv/bootstrap/resolve-lock.nix +116 -0
- package/.devenv/changelog-cache.json +13 -0
- package/.devenv/devenv.fish +252 -0
- package/.devenv/imports.txt +0 -0
- package/.devenv/input-paths.txt +8 -0
- package/.devenv/load-exports +1 -0
- package/.devenv/nix-eval-cache.db +0 -0
- package/.devenv/nix-eval-cache.db.init.lock +0 -0
- package/.devenv/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
- package/.devenv/nixpkgs-config-c46eff8321b73149.nix +29 -0
- package/.devenv/profiles/nix/bootstrap/bootstrapLib.nix +571 -0
- package/.devenv/profiles/nix/bootstrap/default.nix +19 -0
- package/.devenv/profiles/nix/bootstrap/resolve-lock.nix +157 -0
- package/.devenv/profiles/nix/imports.txt +0 -0
- package/.devenv/profiles/nix/input-paths.txt +4 -0
- package/.devenv/profiles/nix/load-exports +1 -0
- package/.devenv/profiles/nix/nix-eval-cache.db +0 -0
- package/.devenv/profiles/nix/nix-eval-cache.db-shm +0 -0
- package/.devenv/profiles/nix/nix-eval-cache.db-wal +0 -0
- package/.devenv/profiles/nix/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
- package/.devenv/profiles/nix/shell-0d722b4fe4724c8e.sh +2270 -0
- package/.devenv/profiles/nix/shell-314b72302fb2c916.sh +2270 -0
- package/.devenv/profiles/nix/shell-6a4b00b5ca837a3b.sh +2270 -0
- package/.devenv/profiles/nix/shell-956adc1e664f64c3.sh +2270 -0
- package/.devenv/profiles/nix/shell-9dbff87fad44e8d9.sh +2270 -0
- package/.devenv/profiles/nix/shell-b1e9e1f82076662f.sh +2270 -0
- package/.devenv/profiles/nix/shell-b4f4bbfa36797bee.sh +2270 -0
- package/.devenv/profiles/nix/shell-c4b190d331c48d67.sh +2270 -0
- package/.devenv/profiles/nix/state/files.json +1 -0
- package/.devenv/profiles/nix/state/tasks.db +0 -0
- package/.devenv/profiles/nix/state/tasks.db-shm +0 -0
- package/.devenv/profiles/nix/state/tasks.db-wal +0 -0
- package/.devenv/profiles/nix/task-names.txt +5 -0
- package/.devenv/shell-086ca2c39799e6a6.sh +2270 -0
- package/.devenv/shell-2c06a35dd99be3d1.sh +2270 -0
- package/.devenv/shell-36f1fe0faec08873.sh +2270 -0
- package/.devenv/shell-676361065bda5b43.sh +2270 -0
- package/.devenv/shell-9f6cb513d1721fef.sh +2270 -0
- package/.devenv/shell-c0e4459b4f5922d7.sh +2270 -0
- package/.devenv/shell-c862a0db6e9ad5f4.sh +2270 -0
- package/.devenv/shell-d71ade933a43e837.sh +2270 -0
- package/.devenv/shell-dd73aac05b182946.sh +2270 -0
- package/.devenv/shell-e39d0b30a7e0eb13.sh +2270 -0
- package/.devenv/shell-env.sh +2275 -0
- package/.devenv/shell-f924d749ff8c17ee.sh +2270 -0
- package/.devenv/shell-rcfile.sh +152 -0
- package/.devenv/state/files.json +5 -0
- 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/state/tasks.db.init.lock +0 -0
- package/.devenv/task-names.txt +7 -0
- package/.github/workflows/codeql.yml +72 -72
- package/.github/workflows/test.yml +31 -31
- package/.prettierignore +9 -0
- package/CHANGELOG.md +609 -427
- package/LICENSE +121 -121
- package/README.md +2 -2
- package/devenv.lock +103 -0
- package/devenv.nix +35 -0
- package/devenv.yaml +23 -0
- package/dist/errors/bad_request.js +7 -7
- package/dist/errors/bad_request.js.map +1 -1
- package/dist/errors/captcha_required.js +18 -18
- package/dist/errors/captcha_required.js.map +1 -1
- package/dist/errors/email_exists.js +7 -7
- package/dist/errors/email_exists.js.map +1 -1
- package/dist/errors/error.js +2 -2
- package/dist/errors/error_base.js +42 -42
- package/dist/errors/error_base.js.map +1 -1
- package/dist/errors/index.js +28 -28
- package/dist/errors/invalid_client.js +7 -7
- package/dist/errors/invalid_client.js.map +1 -1
- package/dist/errors/invalid_email.js +7 -7
- package/dist/errors/invalid_email.js.map +1 -1
- package/dist/errors/invalid_grant.js +7 -7
- package/dist/errors/invalid_grant.js.map +1 -1
- package/dist/errors/not_found.js +2 -2
- package/dist/errors/permission_denied.js +7 -7
- package/dist/errors/permission_denied.js.map +1 -1
- package/dist/errors/unauthorized.js +7 -7
- package/dist/errors/unauthorized.js.map +1 -1
- package/dist/errors/wrong_params.js +7 -7
- package/dist/errors/wrong_params.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/payloads/activity.js +49 -49
- package/dist/payloads/activity.js.map +1 -1
- package/dist/payloads/app.js +2 -2
- package/dist/payloads/appeal.js +13 -13
- package/dist/payloads/appeal.js.map +1 -1
- package/dist/payloads/ban.js +35 -35
- package/dist/payloads/ban.js.map +1 -1
- package/dist/payloads/base.js +2 -2
- package/dist/payloads/chat.js +37 -0
- package/dist/payloads/chat.js.map +1 -0
- package/dist/payloads/client.js +12 -12
- package/dist/payloads/client.js.map +1 -1
- package/dist/payloads/comment.js +41 -41
- package/dist/payloads/comment.js.map +1 -1
- package/dist/payloads/content.js +175 -175
- package/dist/payloads/content.js.map +1 -1
- package/dist/payloads/index.js +28 -26
- package/dist/payloads/index.js.map +1 -1
- package/dist/payloads/strike.js +2 -2
- package/dist/payloads/topics.js +72 -0
- package/dist/payloads/topics.js.map +1 -0
- package/dist/payloads/user.js +214 -214
- package/dist/payloads/user.js.map +1 -1
- package/dist/rest/account.js +2 -2
- package/dist/rest/content.js +53 -53
- package/dist/rest/content.js.map +1 -1
- package/dist/rest/counters.js +2 -2
- package/dist/rest/endpoints.js +198 -198
- package/dist/rest/endpoints.js.map +1 -1
- package/dist/rest/explore.js +81 -81
- package/dist/rest/explore.js.map +1 -1
- package/dist/rest/feeds.js +2 -2
- package/dist/rest/index.js +24 -24
- package/dist/rest/issues.js +2 -2
- package/dist/rest/oauth2.js +8 -8
- package/dist/rest/oauth2.js.map +1 -1
- package/dist/utils/index.js +18 -18
- package/dist/utils/rest.js +2 -2
- package/dist/utils/util.js +2 -2
- package/eslint.config.mjs +18 -0
- package/package.json +66 -50
- package/prettier.config.js +15 -0
- package/tag-check.sh +111 -0
- package/types/errors/bad_request.d.ts +11 -11
- package/types/errors/bad_request.d.ts.map +1 -1
- package/types/errors/captcha_required.d.ts +32 -32
- package/types/errors/captcha_required.d.ts.map +1 -1
- package/types/errors/email_exists.d.ts +14 -14
- package/types/errors/email_exists.d.ts.map +1 -1
- package/types/errors/error.d.ts +28 -28
- package/types/errors/error.d.ts.map +1 -1
- package/types/errors/error_base.d.ts +60 -60
- package/types/errors/error_base.d.ts.map +1 -1
- package/types/errors/index.d.ts +12 -12
- package/types/errors/invalid_client.d.ts +14 -14
- package/types/errors/invalid_client.d.ts.map +1 -1
- package/types/errors/invalid_email.d.ts +14 -14
- package/types/errors/invalid_email.d.ts.map +1 -1
- package/types/errors/invalid_grant.d.ts +11 -11
- package/types/errors/invalid_grant.d.ts.map +1 -1
- package/types/errors/not_found.d.ts +7 -7
- package/types/errors/permission_denied.d.ts +11 -11
- package/types/errors/permission_denied.d.ts.map +1 -1
- package/types/errors/unauthorized.d.ts +11 -11
- package/types/errors/unauthorized.d.ts.map +1 -1
- package/types/errors/wrong_params.d.ts +10 -10
- package/types/errors/wrong_params.d.ts.map +1 -1
- package/types/index.d.ts +4 -4
- package/types/payloads/activity.d.ts +113 -113
- package/types/payloads/activity.d.ts.map +1 -1
- package/types/payloads/app.d.ts +265 -265
- package/types/payloads/appeal.d.ts +21 -21
- package/types/payloads/appeal.d.ts.map +1 -1
- package/types/payloads/ban.d.ts +84 -84
- package/types/payloads/ban.d.ts.map +1 -1
- package/types/payloads/base.d.ts +4 -4
- package/types/payloads/chat.d.ts +117 -0
- package/types/payloads/chat.d.ts.map +1 -0
- package/types/payloads/client.d.ts +107 -107
- package/types/payloads/client.d.ts.map +1 -1
- package/types/payloads/comment.d.ts +123 -123
- package/types/payloads/comment.d.ts.map +1 -1
- package/types/payloads/content.d.ts +676 -677
- package/types/payloads/content.d.ts.map +1 -1
- package/types/payloads/index.d.ts +12 -10
- package/types/payloads/index.d.ts.map +1 -1
- package/types/payloads/strike.d.ts +14 -14
- package/types/payloads/topics.d.ts +45 -0
- package/types/payloads/topics.d.ts.map +1 -0
- package/types/payloads/user.d.ts +522 -522
- package/types/payloads/user.d.ts.map +1 -1
- package/types/rest/account.d.ts +3 -3
- package/types/rest/account.d.ts.map +1 -1
- package/types/rest/content.d.ts +95 -95
- package/types/rest/content.d.ts.map +1 -1
- package/types/rest/counters.d.ts +9 -9
- package/types/rest/counters.d.ts.map +1 -1
- package/types/rest/endpoints.d.ts +152 -152
- package/types/rest/explore.d.ts +112 -112
- package/types/rest/explore.d.ts.map +1 -1
- package/types/rest/feeds.d.ts +16 -16
- package/types/rest/index.d.ts +8 -8
- package/types/rest/issues.d.ts +15 -15
- package/types/rest/oauth2.d.ts +36 -36
- package/types/rest/oauth2.d.ts.map +1 -1
- package/types/utils/index.d.ts +2 -2
- package/types/utils/rest.d.ts +49 -49
- package/types/utils/rest.d.ts.map +1 -1
- package/types/utils/util.d.ts +79 -79
- package/types/utils/util.d.ts.map +1 -1
package/types/utils/util.d.ts
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pixel size of an image or video
|
|
3
|
-
*/
|
|
4
|
-
export interface Size {
|
|
5
|
-
/**
|
|
6
|
-
* Width (in pixels)
|
|
7
|
-
*/
|
|
8
|
-
w: number;
|
|
9
|
-
/**
|
|
10
|
-
* Height (in pixels)
|
|
11
|
-
*/
|
|
12
|
-
h: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A color hex code without `#`
|
|
16
|
-
* @example
|
|
17
|
-
* '55ff00'
|
|
18
|
-
*/
|
|
19
|
-
export
|
|
20
|
-
/**
|
|
21
|
-
* Conditional post type.\
|
|
22
|
-
* `T` Conditional\
|
|
23
|
-
* Returns `A` if `T` is true\
|
|
24
|
-
* Returns `B` if `T` is false\
|
|
25
|
-
* Returns `A|B` if T is neither true or false\
|
|
26
|
-
* @example
|
|
27
|
-
* class Foo<Ready extends boolean = boolean> {
|
|
28
|
-
* bar: If<Ready, number, null>
|
|
29
|
-
* isReady(): this is Foo<true> {
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
*/
|
|
33
|
-
export
|
|
34
|
-
/**
|
|
35
|
-
* UNIX Epoch in seconds
|
|
36
|
-
* ? For better accuracy, convert to milliseconds
|
|
37
|
-
*/
|
|
38
|
-
export
|
|
39
|
-
/**
|
|
40
|
-
* UNIX Epoch in milliseconds
|
|
41
|
-
*/
|
|
42
|
-
export
|
|
43
|
-
/**
|
|
44
|
-
* @example
|
|
45
|
-
* interface Foo {
|
|
46
|
-
* bar: 'baz',
|
|
47
|
-
* spam: 'eggs',
|
|
48
|
-
* waldo: 'fred'
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* type BarOrSpamOrWaldo = ValueOf<Foo> // Expect 'baz'|'eggs'|'fred'
|
|
52
|
-
* type Bar = ValueOf<Foo, 'bar'> // Expect 'baz'
|
|
53
|
-
* type BarOrSpam = ValueOf<Foo, 'bar'|'spam'> // Expect 'baz'|'eggs'
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
export
|
|
57
|
-
/**
|
|
58
|
-
* Like {@link Pick}, but each key is made required
|
|
59
|
-
* @example
|
|
60
|
-
* interface Foo {
|
|
61
|
-
* bar?: string
|
|
62
|
-
* spam?: number
|
|
63
|
-
* }
|
|
64
|
-
*
|
|
65
|
-
* type FooBar = Has<Foo, 'bar'>; // Expect { bar: string }
|
|
66
|
-
* type FooBarOrSpam = Has<Foo, 'bar'|'spam'>; // Expect { bar: string; spam: number }
|
|
67
|
-
*/
|
|
68
|
-
export
|
|
69
|
-
[P in K]-?: T[P];
|
|
70
|
-
};
|
|
71
|
-
export
|
|
72
|
-
export
|
|
73
|
-
/**
|
|
74
|
-
* Represents a raw JSON Object
|
|
75
|
-
*/
|
|
76
|
-
export interface JSONObject {
|
|
77
|
-
[key: string]: JSONValue;
|
|
78
|
-
[index: number]: never;
|
|
79
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Pixel size of an image or video
|
|
3
|
+
*/
|
|
4
|
+
export interface Size {
|
|
5
|
+
/**
|
|
6
|
+
* Width (in pixels)
|
|
7
|
+
*/
|
|
8
|
+
w: number;
|
|
9
|
+
/**
|
|
10
|
+
* Height (in pixels)
|
|
11
|
+
*/
|
|
12
|
+
h: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A color hex code without `#`
|
|
16
|
+
* @example
|
|
17
|
+
* '55ff00'
|
|
18
|
+
*/
|
|
19
|
+
export type HexCode = string;
|
|
20
|
+
/**
|
|
21
|
+
* Conditional post type.\
|
|
22
|
+
* `T` Conditional\
|
|
23
|
+
* Returns `A` if `T` is true\
|
|
24
|
+
* Returns `B` if `T` is false\
|
|
25
|
+
* Returns `A|B` if T is neither true or false\
|
|
26
|
+
* @example
|
|
27
|
+
* class Foo<Ready extends boolean = boolean> {
|
|
28
|
+
* bar: If<Ready, number, null>
|
|
29
|
+
* isReady(): this is Foo<true> {
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
export type If<T extends boolean, A, B = null> = T extends true ? A : T extends false ? B : A | B;
|
|
34
|
+
/**
|
|
35
|
+
* UNIX Epoch in seconds
|
|
36
|
+
* ? For better accuracy, convert to milliseconds
|
|
37
|
+
*/
|
|
38
|
+
export type EpochSec = number;
|
|
39
|
+
/**
|
|
40
|
+
* UNIX Epoch in milliseconds
|
|
41
|
+
*/
|
|
42
|
+
export type EpochMs = number;
|
|
43
|
+
/**
|
|
44
|
+
* @example
|
|
45
|
+
* interface Foo {
|
|
46
|
+
* bar: 'baz',
|
|
47
|
+
* spam: 'eggs',
|
|
48
|
+
* waldo: 'fred'
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* type BarOrSpamOrWaldo = ValueOf<Foo> // Expect 'baz'|'eggs'|'fred'
|
|
52
|
+
* type Bar = ValueOf<Foo, 'bar'> // Expect 'baz'
|
|
53
|
+
* type BarOrSpam = ValueOf<Foo, 'bar'|'spam'> // Expect 'baz'|'eggs'
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export type ValueOf<T, K extends keyof T = keyof T> = T[K];
|
|
57
|
+
/**
|
|
58
|
+
* Like {@link Pick}, but each key is made required
|
|
59
|
+
* @example
|
|
60
|
+
* interface Foo {
|
|
61
|
+
* bar?: string
|
|
62
|
+
* spam?: number
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* type FooBar = Has<Foo, 'bar'>; // Expect { bar: string }
|
|
66
|
+
* type FooBarOrSpam = Has<Foo, 'bar'|'spam'>; // Expect { bar: string; spam: number }
|
|
67
|
+
*/
|
|
68
|
+
export type Has<T, K extends keyof T> = {
|
|
69
|
+
[P in K]-?: T[P];
|
|
70
|
+
};
|
|
71
|
+
export type Primitive = string | number | boolean | null;
|
|
72
|
+
export type JSONValue = Primitive | JSONObject | JSONValue[];
|
|
73
|
+
/**
|
|
74
|
+
* Represents a raw JSON Object
|
|
75
|
+
*/
|
|
76
|
+
export interface JSONObject {
|
|
77
|
+
[key: string]: JSONValue;
|
|
78
|
+
[index: number]: never;
|
|
79
|
+
}
|
|
80
80
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,IAAI,GAC5D,CAAC,GACD,CAAC,SAAS,KAAK,GACf,CAAC,GACD,CAAC,GAAG,CAAC,CAAC;AAET;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;CACvB"}
|