@modrinth/api-client 0.30.0 → 0.32.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.
Files changed (105) hide show
  1. package/dist/index.d.ts +7103 -28
  2. package/dist/index.js +1 -0
  3. package/dist/index.js.map +7 -0
  4. package/package.json +4 -2
  5. package/dist/core/abstract-client.d.ts +0 -163
  6. package/dist/core/abstract-feature.d.ts +0 -72
  7. package/dist/core/abstract-module.d.ts +0 -10
  8. package/dist/core/abstract-sync.d.ts +0 -61
  9. package/dist/core/abstract-upload-client.d.ts +0 -20
  10. package/dist/core/abstract-websocket.d.ts +0 -52
  11. package/dist/core/errors.d.ts +0 -48
  12. package/dist/features/auth.d.ts +0 -47
  13. package/dist/features/circuit-breaker.d.ts +0 -139
  14. package/dist/features/node-auth.d.ts +0 -58
  15. package/dist/features/panel-version.d.ts +0 -7
  16. package/dist/features/retry.d.ts +0 -87
  17. package/dist/features/verbose-logging.d.ts +0 -6
  18. package/dist/modules/archon/actions/v1.d.ts +0 -10
  19. package/dist/modules/archon/backups/v1.d.ts +0 -44
  20. package/dist/modules/archon/backups-queue/v1.d.ts +0 -25
  21. package/dist/modules/archon/content/v1.d.ts +0 -48
  22. package/dist/modules/archon/index.d.ts +0 -8
  23. package/dist/modules/archon/nodes/internal.d.ts +0 -10
  24. package/dist/modules/archon/notices/v0.d.ts +0 -38
  25. package/dist/modules/archon/options/v1.d.ts +0 -9
  26. package/dist/modules/archon/properties/v1.d.ts +0 -9
  27. package/dist/modules/archon/server-users/v1.d.ts +0 -30
  28. package/dist/modules/archon/servers/v0.d.ts +0 -122
  29. package/dist/modules/archon/servers/v1.d.ts +0 -30
  30. package/dist/modules/archon/transfers/internal.d.ts +0 -25
  31. package/dist/modules/archon/types.d.ts +0 -941
  32. package/dist/modules/index.d.ts +0 -181
  33. package/dist/modules/iso3166/index.d.ts +0 -24
  34. package/dist/modules/iso3166/types.d.ts +0 -21
  35. package/dist/modules/kyros/content/v1.d.ts +0 -23
  36. package/dist/modules/kyros/files/v0.d.ts +0 -123
  37. package/dist/modules/kyros/logs/v1.d.ts +0 -6
  38. package/dist/modules/kyros/types.d.ts +0 -44
  39. package/dist/modules/kyros/upload-sessions/v1.d.ts +0 -18
  40. package/dist/modules/labrinth/affiliate/internal.d.ts +0 -30
  41. package/dist/modules/labrinth/analytics/v3.d.ts +0 -56
  42. package/dist/modules/labrinth/attribution/internal.d.ts +0 -47
  43. package/dist/modules/labrinth/auth/internal.d.ts +0 -19
  44. package/dist/modules/labrinth/auth/v2.d.ts +0 -98
  45. package/dist/modules/labrinth/billing/internal.d.ts +0 -65
  46. package/dist/modules/labrinth/campaign/internal.d.ts +0 -10
  47. package/dist/modules/labrinth/collections.d.ts +0 -80
  48. package/dist/modules/labrinth/content/v3.d.ts +0 -6
  49. package/dist/modules/labrinth/external-projects/internal.d.ts +0 -9
  50. package/dist/modules/labrinth/friends/v3.d.ts +0 -23
  51. package/dist/modules/labrinth/globals/internal.d.ts +0 -11
  52. package/dist/modules/labrinth/images/v3.d.ts +0 -7
  53. package/dist/modules/labrinth/index.d.ts +0 -31
  54. package/dist/modules/labrinth/limits/v3.d.ts +0 -17
  55. package/dist/modules/labrinth/moderation/internal.d.ts +0 -12
  56. package/dist/modules/labrinth/notifications/v2.d.ts +0 -73
  57. package/dist/modules/labrinth/oauth/internal.d.ts +0 -97
  58. package/dist/modules/labrinth/organizations/v3.d.ts +0 -66
  59. package/dist/modules/labrinth/pats/v2.d.ts +0 -31
  60. package/dist/modules/labrinth/payout/v3.d.ts +0 -30
  61. package/dist/modules/labrinth/payouts/v3.d.ts +0 -15
  62. package/dist/modules/labrinth/projects/v2.d.ts +0 -169
  63. package/dist/modules/labrinth/projects/v3.d.ts +0 -110
  64. package/dist/modules/labrinth/reports/v3.d.ts +0 -81
  65. package/dist/modules/labrinth/server-ping/internal.d.ts +0 -10
  66. package/dist/modules/labrinth/sessions/v2.d.ts +0 -17
  67. package/dist/modules/labrinth/state/index.d.ts +0 -17
  68. package/dist/modules/labrinth/tags/v2.d.ts +0 -19
  69. package/dist/modules/labrinth/teams/v2.d.ts +0 -57
  70. package/dist/modules/labrinth/teams/v3.d.ts +0 -18
  71. package/dist/modules/labrinth/tech-review/internal.d.ts +0 -77
  72. package/dist/modules/labrinth/threads/v3.d.ts +0 -57
  73. package/dist/modules/labrinth/types.d.ts +0 -2118
  74. package/dist/modules/labrinth/users/v2.d.ts +0 -101
  75. package/dist/modules/labrinth/users/v3.d.ts +0 -37
  76. package/dist/modules/labrinth/versions/v2.d.ts +0 -75
  77. package/dist/modules/labrinth/versions/v3.d.ts +0 -123
  78. package/dist/modules/launcher-meta/types.d.ts +0 -25
  79. package/dist/modules/launcher-meta/v0.d.ts +0 -17
  80. package/dist/modules/mclogs/insights/v1.d.ts +0 -6
  81. package/dist/modules/mclogs/logs/v1.d.ts +0 -6
  82. package/dist/modules/mclogs/types.d.ts +0 -60
  83. package/dist/modules/paper/types.d.ts +0 -22
  84. package/dist/modules/paper/v3.d.ts +0 -19
  85. package/dist/modules/purpur/types.d.ts +0 -15
  86. package/dist/modules/purpur/v2.d.ts +0 -16
  87. package/dist/modules/types.d.ts +0 -8
  88. package/dist/platform/generic.d.ts +0 -28
  89. package/dist/platform/nuxt.d.ts +0 -88
  90. package/dist/platform/sync-generic.d.ts +0 -16
  91. package/dist/platform/tauri.d.ts +0 -35
  92. package/dist/platform/websocket-generic.d.ts +0 -16
  93. package/dist/platform/xhr-upload-client.d.ts +0 -15
  94. package/dist/state/node-auth.d.ts +0 -36
  95. package/dist/types/client.d.ts +0 -70
  96. package/dist/types/errors.d.ts +0 -43
  97. package/dist/types/index.d.ts +0 -10
  98. package/dist/types/request.d.ts +0 -124
  99. package/dist/types/upload.d.ts +0 -92
  100. package/dist/utils/fetch.d.ts +0 -4
  101. package/dist/utils/jwt-retry.d.ts +0 -5
  102. package/dist/utils/node-url.d.ts +0 -2
  103. package/dist/utils/pingtest.d.ts +0 -8
  104. package/dist/utils/sse.d.ts +0 -24
  105. package/dist/utils/types.d.ts +0 -2
@@ -1,101 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthUsersV2Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get a user by ID or username
7
- *
8
- * @param idOrUsername - The user's ID or username
9
- * @returns Promise resolving to the user data
10
- *
11
- * @example
12
- * ```typescript
13
- * const user = await client.labrinth.users_v2.get('my_user')
14
- * ```
15
- */
16
- get(idOrUsername: string): Promise<Labrinth.Users.v2.User>;
17
- /**
18
- * Get multiple users by their IDs
19
- *
20
- * @param ids - Array of user IDs
21
- * @returns Promise resolving to an array of users
22
- *
23
- * @example
24
- * ```typescript
25
- * const users = await client.labrinth.users_v2.getMultiple(['id1', 'id2'])
26
- * ```
27
- */
28
- getMultiple(ids: string[]): Promise<Labrinth.Users.v2.User[]>;
29
- /**
30
- * Get a user's projects
31
- *
32
- * @param idOrUsername - The user's ID or username
33
- * @returns Promise resolving to an array of the user's projects
34
- *
35
- * @example
36
- * ```typescript
37
- * const projects = await client.labrinth.users_v2.getProjects('my_user')
38
- * ```
39
- */
40
- getProjects(idOrUsername: string): Promise<Labrinth.Projects.v2.Project[]>;
41
- /**
42
- * Get a user's organizations
43
- *
44
- * @param idOrUsername - The user's ID or username
45
- * @returns Promise resolving to an array of the user's organizations
46
- *
47
- * @example
48
- * ```typescript
49
- * const orgs = await client.labrinth.users_v2.getOrganizations('my_user')
50
- * ```
51
- */
52
- getOrganizations(idOrUsername: string): Promise<Labrinth.Organizations.v3.Organization[]>;
53
- /**
54
- * Get a user's collections
55
- *
56
- * @param idOrUsername - The user's ID or username
57
- * @returns Promise resolving to an array of the user's collections
58
- *
59
- * @example
60
- * ```typescript
61
- * const collections = await client.labrinth.users_v2.getCollections('my_user')
62
- * ```
63
- */
64
- getCollections(idOrUsername: string): Promise<Labrinth.Collections.Collection[]>;
65
- /**
66
- * Get a user's notifications
67
- *
68
- * @param idOrUsername - The user's ID or username
69
- * @returns Promise resolving to an array of the user's notifications
70
- *
71
- * @example
72
- * ```typescript
73
- * const notifications = await client.labrinth.users_v2.getNotifications('my_user')
74
- * ```
75
- */
76
- getNotifications(idOrUsername: string): Promise<Labrinth.Notifications.v2.Notification[]>;
77
- /**
78
- * Get projects a user follows
79
- *
80
- * @param idOrUsername - The user's ID or username
81
- * @returns Promise resolving to an array of followed projects
82
- *
83
- * @example
84
- * ```typescript
85
- * const projects = await client.labrinth.users_v2.getFollowedProjects('my_user')
86
- * ```
87
- */
88
- getFollowedProjects(idOrUsername: string): Promise<Labrinth.Projects.v2.Project[]>;
89
- /**
90
- * Update a user
91
- *
92
- * @param idOrUsername - The user's ID or username
93
- * @param data - Fields to update
94
- *
95
- * @example
96
- * ```typescript
97
- * await client.labrinth.users_v2.patch('my_user', { role: 'admin' })
98
- * ```
99
- */
100
- patch(idOrUsername: string, data: Partial<Pick<Labrinth.Users.v2.User, 'badges' | 'role'>>): Promise<void>;
101
- }
@@ -1,37 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthUsersV3Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get the authenticated user.
7
- * GET /v3/user
8
- */
9
- getAuthenticated(): Promise<Labrinth.Users.v3.User>;
10
- /**
11
- * Get a user by ID or username
12
- *
13
- * @param idOrUsername - The user's ID or username
14
- * @returns Promise resolving to the user data
15
- *
16
- * GET /v3/user/{id}
17
- */
18
- get(idOrUsername: string): Promise<Labrinth.Users.v3.User>;
19
- /**
20
- * Search users by username prefix.
21
- *
22
- * @param query - Username search query
23
- * @returns Promise resolving to compact user search results
24
- *
25
- * GET /v3/users/search?query=:query
26
- */
27
- search(query: string): Promise<Labrinth.Users.v3.SearchUser[]>;
28
- /**
29
- * Get all projects the authenticated user can access directly or through
30
- * their organizations.
31
- *
32
- * @param idOrUsername - User ID or username. Must be the authenticated user.
33
- *
34
- * GET /v3/user/{id}/all-projects
35
- */
36
- getAllProjects(idOrUsername: string): Promise<Labrinth.Users.v3.AllProjectsResponse>;
37
- }
@@ -1,75 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthVersionsV2Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get versions for a project (v2)
7
- *
8
- * @param id - Project ID or slug (e.g., 'sodium' or 'AANobbMI')
9
- * @param options - Optional query parameters to filter versions
10
- * @returns Promise resolving to an array of v2 versions
11
- *
12
- * @example
13
- * ```typescript
14
- * const versions = await client.labrinth.versions_v2.getProjectVersions('sodium')
15
- * const filteredVersions = await client.labrinth.versions_v2.getProjectVersions('sodium', {
16
- * game_versions: ['1.20.1'],
17
- * loaders: ['fabric'],
18
- * include_changelog: false
19
- * })
20
- * console.log(versions[0].version_number)
21
- * ```
22
- */
23
- getProjectVersions(id: string, options?: Labrinth.Versions.v2.GetProjectVersionsParams): Promise<Labrinth.Versions.v2.Version[]>;
24
- /**
25
- * Get a specific version by ID (v2)
26
- *
27
- * @param id - Version ID
28
- * @returns Promise resolving to the v2 version data
29
- *
30
- * @example
31
- * ```typescript
32
- * const version = await client.labrinth.versions_v2.getVersion('DXtmvS8i')
33
- * console.log(version.version_number)
34
- * ```
35
- */
36
- getVersion(id: string): Promise<Labrinth.Versions.v2.Version>;
37
- /**
38
- * Get multiple versions by IDs (v2)
39
- *
40
- * @param ids - Array of version IDs
41
- * @returns Promise resolving to an array of v2 versions
42
- *
43
- * @example
44
- * ```typescript
45
- * const versions = await client.labrinth.versions_v2.getVersions(['DXtmvS8i', 'abc123'])
46
- * console.log(versions[0].version_number)
47
- * ```
48
- */
49
- getVersions(ids: string[]): Promise<Labrinth.Versions.v2.Version[]>;
50
- /**
51
- * Get a version from a project by version ID or number (v2)
52
- *
53
- * @param projectId - Project ID or slug
54
- * @param versionId - Version ID or version number
55
- * @returns Promise resolving to the v2 version data
56
- *
57
- * @example
58
- * ```typescript
59
- * const version = await client.labrinth.versions_v2.getVersionFromIdOrNumber('sodium', 'DXtmvS8i')
60
- * const versionByNumber = await client.labrinth.versions_v2.getVersionFromIdOrNumber('sodium', '0.4.12')
61
- * ```
62
- */
63
- getVersionFromIdOrNumber(projectId: string, versionId: string): Promise<Labrinth.Versions.v2.Version>;
64
- /**
65
- * Delete a version by ID (v2)
66
- *
67
- * @param versionId - Version ID
68
- *
69
- * @example
70
- * ```typescript
71
- * await client.labrinth.versions_v2.deleteVersion('DXtmvS8i')
72
- * ```
73
- */
74
- deleteVersion(versionId: string): Promise<void>;
75
- }
@@ -1,123 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { UploadHandle } from '../../../types/upload';
3
- import type { Labrinth } from '../types';
4
- export declare class LabrinthVersionsV3Module extends AbstractModule {
5
- getModuleID(): string;
6
- /**
7
- * Get versions for a project (v3)
8
- *
9
- * @param id - Project ID or slug (e.g., 'sodium' or 'AANobbMI')
10
- * @param options - Optional query parameters to filter versions
11
- * @returns Promise resolving to an array of v3 versions
12
- *
13
- * @example
14
- * ```typescript
15
- * const versions = await client.labrinth.versions_v3.getProjectVersions('sodium')
16
- * const filteredVersions = await client.labrinth.versions_v3.getProjectVersions('sodium', {
17
- * game_versions: ['1.20.1'],
18
- * loaders: ['fabric']
19
- * })
20
- * console.log(versions[0].version_number)
21
- * ```
22
- */
23
- getProjectVersions(id: string, options?: Labrinth.Versions.v3.GetProjectVersionsParams): Promise<Labrinth.Versions.v3.Version[]>;
24
- /**
25
- * Get a specific version by ID (v3)
26
- *
27
- * @param id - Version ID
28
- * @returns Promise resolving to the v3 version data
29
- *
30
- * @example
31
- * ```typescript
32
- * const version = await client.labrinth.versions_v3.getVersion('DXtmvS8i')
33
- * console.log(version.version_number)
34
- * ```
35
- */
36
- getVersion(id: string): Promise<Labrinth.Versions.v3.Version>;
37
- /**
38
- * Get multiple versions by IDs (v3)
39
- *
40
- * @param ids - Array of version IDs
41
- * @returns Promise resolving to an array of v3 versions
42
- *
43
- * @example
44
- * ```typescript
45
- * const versions = await client.labrinth.versions_v3.getVersions(['DXtmvS8i', 'abc123'])
46
- * console.log(versions[0].version_number)
47
- * ```
48
- */
49
- getVersions(ids: string[]): Promise<Labrinth.Versions.v3.Version[]>;
50
- /**
51
- * Get a version from a project by version ID or number (v3)
52
- *
53
- * @param projectId - Project ID or slug
54
- * @param versionId - Version ID or version number
55
- * @returns Promise resolving to the v3 version data
56
- *
57
- * @example
58
- * ```typescript
59
- * const version = await client.labrinth.versions_v3.getVersionFromIdOrNumber('sodium', 'DXtmvS8i')
60
- * const versionByNumber = await client.labrinth.versions_v3.getVersionFromIdOrNumber('sodium', '0.4.12')
61
- * ```
62
- */
63
- getVersionFromIdOrNumber(projectId: string, versionId: string): Promise<Labrinth.Versions.v3.Version>;
64
- /**
65
- * Create a new version for a project (v3)
66
- *
67
- * Creates a new version on an existing project. At least one file must be
68
- * attached unless the version is created as a draft.
69
- *
70
- * @param data - JSON metadata payload for the version (must include file_parts)
71
- * @param files - Array of uploaded files, in the same order as `data.file_parts`
72
- *
73
- * @returns A promise resolving to the newly created version data
74
- *
75
- * @example
76
- * ```ts
77
- * const version = await client.labrinth.versions_v3.createVersion('sodium', {
78
- * name: 'v0.5.0',
79
- * version_number: '0.5.0',
80
- * version_type: 'release',
81
- * loaders: ['fabric'],
82
- * game_versions: ['1.20.1'],
83
- * project_id: 'sodium',
84
- * file_parts: ['primary']
85
- * }, [fileObject])
86
- * ```
87
- */
88
- createVersion(draftVersion: Labrinth.Versions.v3.DraftVersion, versionFiles: Labrinth.Versions.v3.DraftVersionFile[], projectType?: Labrinth.Projects.v2.ProjectType | null): UploadHandle<Labrinth.Versions.v3.Version>;
89
- /**
90
- * Modify an existing version by ID (v3)
91
- *
92
- * Partially updates a version’s metadata. Only JSON fields may be modified.
93
- * To update files, use the separate "Add files to version" endpoint.
94
- *
95
- * @param versionId - The version ID to update
96
- * @param data - PATCH metadata for this version (all fields optional)
97
- *
98
- * @returns A promise resolving to the updated version data
99
- *
100
- * @example
101
- * ```ts
102
- * const updated = await client.labrinth.versions_v3.modifyVersion('DXtmvS8i', {
103
- * name: 'v1.0.1',
104
- * changelog: 'Updated changelog',
105
- * featured: true,
106
- * status: 'listed'
107
- * })
108
- * ```
109
- */
110
- modifyVersion(versionId: string, data: Labrinth.Versions.v3.ModifyVersionRequest): Promise<Labrinth.Versions.v3.Version>;
111
- /**
112
- * Delete a version by ID (v3)
113
- *
114
- * @param versionId - Version ID
115
- *
116
- * @example
117
- * ```typescript
118
- * await client.labrinth.versions_v3.deleteVersion('DXtmvS8i')
119
- * ```
120
- */
121
- deleteVersion(versionId: string): Promise<void>;
122
- addFilesToVersion(versionId: string, versionFiles: Labrinth.Versions.v3.DraftVersionFile[]): UploadHandle<Labrinth.Versions.v3.Version>;
123
- }
@@ -1,25 +0,0 @@
1
- export declare namespace LauncherMeta {
2
- namespace Manifest {
3
- namespace v0 {
4
- type LoaderVersion = {
5
- id: string;
6
- url: string;
7
- stable: boolean;
8
- };
9
- type GameVersionEntry = {
10
- id: string;
11
- stable: boolean;
12
- versionGroup?: string;
13
- loaders: LoaderVersion[];
14
- };
15
- type VersionGroup = {
16
- id: string;
17
- loaders: LoaderVersion[];
18
- };
19
- type Manifest = {
20
- gameVersions: GameVersionEntry[];
21
- versionGroups?: VersionGroup[];
22
- };
23
- }
24
- }
25
- }
@@ -1,17 +0,0 @@
1
- import { AbstractModule } from '../../core/abstract-module';
2
- import type { LauncherMeta } from './types';
3
- export type { LauncherMeta } from './types';
4
- export declare class LauncherMetaManifestV0Module extends AbstractModule {
5
- getModuleID(): string;
6
- /**
7
- * Get the loader manifest for a given loader platform.
8
- *
9
- * launcher-meta refuses CORS preflights that ask for the `Content-Type`
10
- * header (returns 403), so we strip the default `Content-Type: application/json`
11
- * the abstract client sets — these are body-less GETs and don't need it.
12
- * Without this the browser preflight is rejected and the GET never fires.
13
- *
14
- * @param loader - Loader platform (fabric, forge, quilt, neo)
15
- */
16
- getManifest(loader: string, formatVersion?: number): Promise<LauncherMeta.Manifest.v0.Manifest>;
17
- }
@@ -1,6 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Mclogs } from '../types';
3
- export declare class MclogsInsightsV1Module extends AbstractModule {
4
- getModuleID(): string;
5
- analyse(content: string): Promise<Mclogs.Insights.v1.InsightsResponse>;
6
- }
@@ -1,6 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Mclogs } from '../types';
3
- export declare class MclogsLogsV1Module extends AbstractModule {
4
- getModuleID(): string;
5
- create(content: string): Promise<Mclogs.Logs.v1.CreateResponse>;
6
- }
@@ -1,60 +0,0 @@
1
- export declare namespace Mclogs {
2
- namespace Insights {
3
- namespace v1 {
4
- type LogEntry = {
5
- level: number;
6
- time: string | null;
7
- prefix: string;
8
- lines: Array<{
9
- number: number;
10
- content: string;
11
- }>;
12
- };
13
- type Solution = {
14
- message: string;
15
- };
16
- type Problem = {
17
- message: string;
18
- counter: number;
19
- entry: LogEntry;
20
- solutions: Solution[];
21
- };
22
- type Information = {
23
- message: string;
24
- counter: number;
25
- label: string;
26
- value: string;
27
- entry: LogEntry;
28
- };
29
- type Analysis = {
30
- problems: Problem[];
31
- information: Information[];
32
- };
33
- type InsightsResponse = {
34
- id: string;
35
- name: string;
36
- type: string;
37
- version: string;
38
- title: string;
39
- analysis: Analysis;
40
- };
41
- }
42
- }
43
- namespace Logs {
44
- namespace v1 {
45
- type CreateResponse = {
46
- success: boolean;
47
- id: string;
48
- source: string | null;
49
- created: number;
50
- expires: number;
51
- size: number;
52
- lines: number;
53
- errors: number;
54
- url: string;
55
- raw: string;
56
- token: string;
57
- };
58
- }
59
- }
60
- }
@@ -1,22 +0,0 @@
1
- export declare namespace Paper {
2
- namespace Versions {
3
- namespace v3 {
4
- type Project = {
5
- project: {
6
- id: string;
7
- name: string;
8
- };
9
- versions: Record<string, string[]>;
10
- };
11
- type BuildChannel = 'STABLE' | 'BETA' | 'ALPHA';
12
- type Build = {
13
- id: number;
14
- time: string;
15
- channel: BuildChannel | string;
16
- };
17
- type VersionBuilds = {
18
- builds: Build[];
19
- };
20
- }
21
- }
22
- }
@@ -1,19 +0,0 @@
1
- import { AbstractModule } from '../../core/abstract-module';
2
- import type { Paper } from './types';
3
- export type { Paper } from './types';
4
- export declare class PaperVersionsV3Module extends AbstractModule {
5
- getModuleID(): string;
6
- /**
7
- * Get the Paper project info including all supported Minecraft versions.
8
- */
9
- getProject(): Promise<Paper.Versions.v3.Project>;
10
- /**
11
- * Get available Paper builds for a Minecraft version (includes channel per build).
12
- *
13
- * Fill (`fill.papermc.io`) returns a JSON array of builds at this path — not a `{ builds }`
14
- * wrapper like some other Paper API shapes — so we normalize to `VersionBuilds`.
15
- *
16
- * @param mcVersion - Minecraft version (e.g. "1.21.4")
17
- */
18
- getBuilds(mcVersion: string): Promise<Paper.Versions.v3.VersionBuilds>;
19
- }
@@ -1,15 +0,0 @@
1
- export declare namespace Purpur {
2
- namespace Versions {
3
- namespace v2 {
4
- type Project = {
5
- project: string;
6
- versions: string[];
7
- };
8
- type VersionBuilds = {
9
- builds: {
10
- all: string[];
11
- };
12
- };
13
- }
14
- }
15
- }
@@ -1,16 +0,0 @@
1
- import { AbstractModule } from '../../core/abstract-module';
2
- import type { Purpur } from './types';
3
- export type { Purpur } from './types';
4
- export declare class PurpurVersionsV2Module extends AbstractModule {
5
- getModuleID(): string;
6
- /**
7
- * Get the Purpur project info including all supported Minecraft versions.
8
- */
9
- getProject(): Promise<Purpur.Versions.v2.Project>;
10
- /**
11
- * Get available Purpur builds for a Minecraft version.
12
- *
13
- * @param mcVersion - Minecraft version (e.g. "1.21.4")
14
- */
15
- getBuilds(mcVersion: string): Promise<Purpur.Versions.v2.VersionBuilds>;
16
- }
@@ -1,8 +0,0 @@
1
- export * from './archon/types';
2
- export * from './iso3166/types';
3
- export * from './kyros/types';
4
- export * from './labrinth/types';
5
- export * from './launcher-meta/types';
6
- export * from './mclogs/types';
7
- export * from './paper/types';
8
- export * from './purpur/types';
@@ -1,28 +0,0 @@
1
- import { ModrinthApiError } from '../core/errors';
2
- import type { ClientConfig } from '../types/client';
3
- import type { RequestOptions } from '../types/request';
4
- import { XHRUploadClient } from './xhr-upload-client';
5
- /**
6
- * Generic platform client using ofetch
7
- *
8
- * This client works in any JavaScript environment (Node.js, browser, workers, etc).
9
- *
10
- * @example
11
- * ```typescript
12
- * const client = new GenericModrinthClient({
13
- * userAgent: 'my-app/1.0.0',
14
- * features: [
15
- * new AuthFeature({ token: async () => getOAuthToken() }),
16
- * new RetryFeature({ maxAttempts: 3 })
17
- * ]
18
- * })
19
- *
20
- * const project = await client.request('/project/sodium', { api: 'labrinth', version: 2 })
21
- * ```
22
- */
23
- export declare class GenericModrinthClient extends XHRUploadClient {
24
- constructor(config: ClientConfig);
25
- protected executeRequest<T>(url: string, options: RequestOptions): Promise<T>;
26
- protected executeStreamRequest(url: string, options: RequestOptions): Promise<ReadableStream<Uint8Array>>;
27
- protected normalizeError(error: unknown): ModrinthApiError;
28
- }
@@ -1,88 +0,0 @@
1
- import { ModrinthApiError } from '../core/errors';
2
- import type { CircuitBreakerState, CircuitBreakerStorage } from '../features/circuit-breaker';
3
- import type { ClientConfig } from '../types/client';
4
- import type { RequestOptions } from '../types/request';
5
- import type { UploadHandle, UploadRequestOptions } from '../types/upload';
6
- import { XHRUploadClient } from './xhr-upload-client';
7
- /**
8
- * Circuit breaker storage using Nuxt's useState
9
- *
10
- * This provides cross-request persistence in SSR while also working in client-side.
11
- * State is shared between requests in the same Nuxt context.
12
- *
13
- * Note: useState must be called during initialization (in setup context) and cached,
14
- * as it won't work during async operations when the Nuxt context may be lost.
15
- */
16
- export declare class NuxtCircuitBreakerStorage implements CircuitBreakerStorage {
17
- private state;
18
- constructor();
19
- get(key: string): CircuitBreakerState | undefined;
20
- set(key: string, state: CircuitBreakerState): void;
21
- clear(key: string): void;
22
- }
23
- /**
24
- * Nuxt-specific configuration
25
- */
26
- export interface NuxtClientConfig extends ClientConfig {
27
- /**
28
- * Rate limit key for server-side requests.
29
- * This is injected as x-ratelimit-key header on server-side.
30
- * Can be a string (for env var) or async function (for CF Secrets Store).
31
- */
32
- rateLimitKey?: string | (() => Promise<string | undefined>);
33
- }
34
- /**
35
- * Nuxt platform client using Nuxt's $fetch
36
- *
37
- * This client is optimized for Nuxt applications and handles SSR/CSR automatically.
38
- *
39
- * Note: upload() is only available in browser context (CSR). It will throw during SSR.
40
- *
41
- * @example
42
- * ```typescript
43
- * // In a Nuxt composable
44
- * const config = useRuntimeConfig()
45
- *
46
- * const client = new NuxtModrinthClient({
47
- * userAgent: 'my-nuxt-app/1.0.0',
48
- * rateLimitKey: import.meta.server ? config.rateLimitKey : undefined,
49
- * features: [
50
- * new AuthFeature({
51
- * token: async () => getOAuthToken()
52
- * }),
53
- * new CircuitBreakerFeature({
54
- * storage: new NuxtCircuitBreakerStorage()
55
- * })
56
- * ]
57
- * })
58
- *
59
- * const project = await client.request('/project/sodium', { api: 'labrinth', version: 2 })
60
- * ```
61
- */
62
- export declare class NuxtModrinthClient extends XHRUploadClient {
63
- protected config: NuxtClientConfig;
64
- private rateLimitKeyResolved;
65
- private rateLimitKeyPromise;
66
- constructor(config: NuxtClientConfig);
67
- /**
68
- * Resolve the rate limit key, handling both string and async function values.
69
- * Results are cached for subsequent calls.
70
- */
71
- private resolveRateLimitKey;
72
- /**
73
- * Override request to resolve rate limit key before calling super.
74
- * This allows async fetching of the key from CF Secrets Store.
75
- */
76
- request<T>(path: string, options: RequestOptions): Promise<T>;
77
- /**
78
- * Upload a file with progress tracking
79
- *
80
- * Note: This method is only available in browser context (CSR).
81
- * Calling during SSR will throw an error.
82
- */
83
- upload<T = void>(path: string, options: UploadRequestOptions): UploadHandle<T>;
84
- protected executeRequest<T>(url: string, options: RequestOptions): Promise<T>;
85
- protected executeStreamRequest(url: string, options: RequestOptions): Promise<ReadableStream<Uint8Array>>;
86
- protected normalizeError(error: unknown): ModrinthApiError;
87
- protected buildDefaultHeaders(): Promise<Record<string, string>>;
88
- }
@@ -1,16 +0,0 @@
1
- import { AbstractSyncClient, type SyncConnectOptions, type SyncEmitterEvents } from '../core/abstract-sync';
2
- export declare class GenericSyncClient extends AbstractSyncClient {
3
- protected emitter: import("mitt").Emitter<SyncEmitterEvents>;
4
- safeConnectServer(serverId: string, options?: SyncConnectOptions): Promise<void>;
5
- disconnect(serverId: string): void;
6
- disconnectAll(): void;
7
- private runConnection;
8
- private consumeStream;
9
- private processParsedItems;
10
- private waitForReconnect;
11
- private closeConnection;
12
- private getReconnectDelay;
13
- private updateLastEventId;
14
- private intentToParam;
15
- private isAbortError;
16
- }