@modrinth/api-client 0.12.0 → 0.14.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.
@@ -0,0 +1,30 @@
1
+ import { AbstractModule } from '../../../core/abstract-module';
2
+ import type { Archon } from '../types';
3
+ export declare class ArchonServerUsersV1Module extends AbstractModule {
4
+ getModuleID(): string;
5
+ /**
6
+ * Get list of users with access to a server
7
+ * GET /v1/servers/:server_id/users
8
+ */
9
+ list(serverId: string): Promise<Archon.ServerUsers.v1.ServerUser[]>;
10
+ /**
11
+ * Add a user to a server
12
+ * POST /v1/servers/:server_id/users
13
+ */
14
+ add(serverId: string, user: Archon.ServerUsers.v1.AddServerUserRequest): Promise<void>;
15
+ /**
16
+ * Re-send an invite to a pending server user.
17
+ * POST /v1/servers/:server_id/users/:user_id/reinvite
18
+ */
19
+ reinvite(serverId: string, userId: string): Promise<Archon.ServerUsers.v1.ReinviteResponse>;
20
+ /**
21
+ * Remove a user from a server
22
+ * DELETE /v1/servers/:server_id/users/:user_id
23
+ */
24
+ delete(serverId: string, userId: string): Promise<void>;
25
+ /**
26
+ * Update a user's server role
27
+ * PATCH /v1/servers/:server_id/users/:user_id
28
+ */
29
+ update(serverId: string, userId: string, role: Archon.ServerUsers.v1.AssignableServerUserRole): Promise<void>;
30
+ }
@@ -0,0 +1,25 @@
1
+ import { AbstractModule } from '../../../core/abstract-module';
2
+ import type { Archon } from '../types';
3
+ export declare class ArchonTransfersInternalModule extends AbstractModule {
4
+ getModuleID(): string;
5
+ /**
6
+ * Schedule transfers for specific servers.
7
+ * POST /_internal/transfers/schedule/servers
8
+ */
9
+ scheduleServers(request: Archon.Transfers.Internal.ScheduleServerTransfersRequest): Promise<Archon.Transfers.Internal.ScheduleTransfersResponse>;
10
+ /**
11
+ * Schedule transfers for all servers on specific nodes.
12
+ * POST /_internal/transfers/schedule/nodes
13
+ */
14
+ scheduleNodes(request: Archon.Transfers.Internal.ScheduleNodeTransfersRequest): Promise<Archon.Transfers.Internal.ScheduleTransfersResponse>;
15
+ /**
16
+ * Get transfer batch history.
17
+ * GET /_internal/transfers/history
18
+ */
19
+ history(options?: Archon.Transfers.Internal.TransferHistoryQuery): Promise<Archon.Transfers.Internal.TransferHistoryResponse>;
20
+ /**
21
+ * Cancel pending transfer batches.
22
+ * POST /_internal/transfers/cancel
23
+ */
24
+ cancel(request: Archon.Transfers.Internal.CancelTransfersRequest): Promise<Archon.Transfers.Internal.CancelTransfersResponse>;
25
+ }
@@ -1,5 +1,211 @@
1
1
  import type { Labrinth } from '../labrinth/types';
2
2
  export declare namespace Archon {
3
+ namespace Nodes {
4
+ namespace Internal {
5
+ type Node = {
6
+ id: string;
7
+ hostname: string;
8
+ region: string;
9
+ created_at: string | null;
10
+ locked: boolean;
11
+ };
12
+ type Server = {
13
+ id: string;
14
+ available: boolean;
15
+ };
16
+ type NodeFull = Node & {
17
+ servers: Server[];
18
+ };
19
+ type Overview = {
20
+ node_hostnames: string[];
21
+ regions: Region[];
22
+ total_servers_active: number;
23
+ };
24
+ type Region = {
25
+ display_name: string;
26
+ country_code: string;
27
+ key: string;
28
+ server_count: number;
29
+ node_count: number;
30
+ };
31
+ type RegionWithStatistics = {
32
+ region: Region;
33
+ active_servers: string[];
34
+ };
35
+ }
36
+ }
37
+ namespace Notices {
38
+ namespace v0 {
39
+ type Notice = {
40
+ id: number;
41
+ dismissable: boolean;
42
+ title: string | null;
43
+ message: string;
44
+ level: string;
45
+ announced: string;
46
+ };
47
+ type ListedNotice = {
48
+ id: number;
49
+ dismissable: boolean;
50
+ message: string;
51
+ title: string | null;
52
+ level: string;
53
+ announce_at: string;
54
+ expires: string | null;
55
+ assigned: Assignment[];
56
+ dismissed_by: Dismisser[];
57
+ };
58
+ type Dismisser = {
59
+ server: string;
60
+ dismissed_on: string;
61
+ };
62
+ type Assignment = {
63
+ kind: string;
64
+ id: string;
65
+ name: string;
66
+ };
67
+ type AssignmentTarget = {
68
+ server: string;
69
+ } | {
70
+ node: string;
71
+ };
72
+ type Announce = {
73
+ message: string;
74
+ title?: string | null;
75
+ level: string;
76
+ dismissable: boolean;
77
+ announce_at: string;
78
+ expires?: string | null;
79
+ };
80
+ type AnnouncePatch = {
81
+ message?: string;
82
+ title?: string | null;
83
+ level?: string;
84
+ dismissable?: boolean;
85
+ announce_at?: string;
86
+ expires?: string | null;
87
+ };
88
+ type PostNoticeResponseBody = {
89
+ id: number;
90
+ };
91
+ }
92
+ }
93
+ namespace Actions {
94
+ namespace v1 {
95
+ type SortOrder = 'asc' | 'desc';
96
+ type ActionName = 'server_created' | 'changed_server_name' | 'changed_server_subdomain' | 'server_reallocated' | 'server_plan_changed' | 'user_invited' | 'user_invite_revoked' | 'user_permission_modified' | 'user_removed' | 'addon_added' | 'addon_uploaded' | 'addon_disabled' | 'addon_enabled' | 'addon_deleted' | 'addon_updated' | 'modpack_changed' | 'modpack_unlinked' | 'server_repaired' | 'server_reset' | 'server_started' | 'server_stopped' | 'server_restarted' | 'server_killed' | 'port_allocation_added' | 'port_allocation_removed' | 'loader_version_edited' | 'game_version_edited' | 'server_properties_modified' | 'file_uploaded' | 'file_deleted' | 'file_renamed' | 'file_edited' | 'sftp_login' | 'console_command_executed' | 'console_cleared' | 'backup_created' | 'backup_renamed' | 'backup_restored' | 'backup_deleted' | 'startup_command_modified' | 'java_runtime_modified' | 'java_version_modified';
97
+ type Action = {
98
+ action: ActionName | string;
99
+ metadata?: unknown;
100
+ };
101
+ type UserPermissionsActionMetadata = {
102
+ user_id: string;
103
+ permissions?: ServerUsers.v1.UserScope | null;
104
+ };
105
+ type ActionUser = {
106
+ type: 'user';
107
+ user_id: string;
108
+ } | {
109
+ type: 'support';
110
+ user_id?: string | null;
111
+ };
112
+ type ActionEntry = {
113
+ actor: ActionUser;
114
+ action: Action;
115
+ server_id: string;
116
+ world_id?: string | null;
117
+ timestamp: string;
118
+ };
119
+ type UserResp = {
120
+ username: string;
121
+ avatar_url?: string | null;
122
+ };
123
+ type AddonResp = {
124
+ title: string;
125
+ slug?: string | null;
126
+ icon_url?: string | null;
127
+ version?: string | null;
128
+ };
129
+ type VersionResp = {
130
+ name: string;
131
+ version_number?: string | null;
132
+ };
133
+ type ActionLogResponse = {
134
+ next_offset?: number | null;
135
+ data: ActionEntry[];
136
+ users: Record<string, UserResp>;
137
+ addons: Record<string, AddonResp>;
138
+ versions: Record<string, VersionResp>;
139
+ };
140
+ type ActionLogFilter = {
141
+ users?: string[];
142
+ worlds?: Array<string | null>;
143
+ actions?: ActionName[];
144
+ };
145
+ type ListActionLogOptions = {
146
+ filter?: ActionLogFilter;
147
+ limit?: number;
148
+ offset?: number;
149
+ order?: SortOrder;
150
+ min_datetime?: string;
151
+ max_datetime?: string;
152
+ };
153
+ }
154
+ }
155
+ namespace Transfers {
156
+ namespace Internal {
157
+ type ProvisionOptions = {
158
+ region?: string | null;
159
+ node_tags: string[];
160
+ };
161
+ type ScheduleServerTransfersRequest = {
162
+ server_ids: string[];
163
+ scheduled_at?: string | null;
164
+ target_region?: string | null;
165
+ node_tags?: string[];
166
+ reason?: string | null;
167
+ };
168
+ type ScheduleNodeTransfersRequest = {
169
+ node_hostnames: string[];
170
+ scheduled_at?: string | null;
171
+ target_region?: string | null;
172
+ node_tags?: string[];
173
+ reason?: string | null;
174
+ cordon_nodes?: boolean;
175
+ tag_nodes?: string | null;
176
+ };
177
+ type ScheduleTransfersResponse = {
178
+ batch_id: number;
179
+ scheduled_count: number;
180
+ };
181
+ type CancelTransfersRequest = {
182
+ batch_ids: number[];
183
+ };
184
+ type CancelTransfersResponse = {
185
+ cancelled_count: number;
186
+ };
187
+ type TransferLogBatchEntry = {
188
+ id: number;
189
+ created_by: string;
190
+ created_at: string;
191
+ reason?: string | null;
192
+ scheduled_at: string;
193
+ cancelled: boolean;
194
+ log_count: number;
195
+ provision_options: ProvisionOptions;
196
+ };
197
+ type TransferHistoryQuery = {
198
+ page?: number;
199
+ page_size?: number;
200
+ };
201
+ type TransferHistoryResponse = {
202
+ batches: TransferLogBatchEntry[];
203
+ total: number;
204
+ page: number;
205
+ page_size: number;
206
+ };
207
+ }
208
+ }
3
209
  namespace Content {
4
210
  namespace v1 {
5
211
  type AddonKind = 'mod' | 'plugin' | 'datapack' | 'shader' | 'resourcepack';
@@ -181,11 +387,58 @@ export declare namespace Archon {
181
387
  };
182
388
  }
183
389
  }
390
+ namespace ServerUsers {
391
+ namespace v1 {
392
+ type ServerUserRole = 'Owner' | 'Editor' | 'Viewer' | 'Unknown';
393
+ type AssignableServerUserRole = Exclude<ServerUserRole, 'Owner' | 'Unknown'>;
394
+ const UserScope: {
395
+ readonly NONE: "";
396
+ readonly SERVER_ADMIN: "SERVER_ADMIN";
397
+ readonly BASE_READ: "BASE_READ";
398
+ readonly POWER_ACTIONS: "POWER_ACTIONS";
399
+ readonly EXEC_COMMANDS: "EXEC_COMMANDS";
400
+ readonly FILES_WRITE: "FILES_WRITE";
401
+ readonly SETUP: "SETUP";
402
+ readonly BACKUPS: "BACKUPS";
403
+ readonly ADVANCED: "ADVANCED";
404
+ readonly RESET_SERVER: "RESET_SERVER";
405
+ readonly MANAGE_USERS: "MANAGE_USERS";
406
+ readonly SUPPORT_AGENT: "SUPPORT_AGENT";
407
+ readonly INFRA_MANAGER: "INFRA_MANAGER";
408
+ readonly INFRA_MANAGER_READ: "INFRA_MANAGER_READ";
409
+ readonly INFRA_SERVERS_XFER: "INFRA_SERVERS_XFER";
410
+ readonly INFRA_USERS: "INFRA_USERS";
411
+ };
412
+ type UserScope = string | number;
413
+ type UserResp = {
414
+ id: string;
415
+ username: string;
416
+ avatar_url?: string | null;
417
+ };
418
+ type ServerUser = {
419
+ user: UserResp;
420
+ added_on?: string | null;
421
+ last_invite_sent?: string | null;
422
+ permissions: UserScope;
423
+ };
424
+ type AddServerUserRequest = {
425
+ server_id?: string | null;
426
+ user_id: string;
427
+ added_on?: string | null;
428
+ role: ServerUserRole;
429
+ };
430
+ type ReinviteResponse = {
431
+ sent: boolean;
432
+ cooldown_seconds: number | null;
433
+ };
434
+ }
435
+ }
184
436
  namespace Servers {
185
437
  namespace v0 {
186
438
  type ServerGetResponse = {
187
439
  servers: Server[];
188
440
  pagination: Pagination;
441
+ users: Record<string, ServerOwner>;
189
442
  };
190
443
  type Pagination = {
191
444
  current_page: number;
@@ -193,6 +446,11 @@ export declare namespace Archon {
193
446
  total_pages: number;
194
447
  total_items: number;
195
448
  };
449
+ type ServerOwner = {
450
+ id: string;
451
+ username: string;
452
+ avatar_url?: string | null;
453
+ };
196
454
  type Status = 'installing' | 'broken' | 'available' | 'suspended';
197
455
  type SuspensionReason = 'moderated' | 'paymentfailed' | 'cancelled' | 'upgrading' | 'other';
198
456
  type Loader = 'Forge' | 'NeoForge' | 'Fabric' | 'Quilt' | 'Purpur' | 'Spigot' | 'Vanilla' | 'Paper';
@@ -220,10 +478,12 @@ export declare namespace Archon {
220
478
  node: NodeInfo | null;
221
479
  flows: Flows;
222
480
  is_medal: boolean;
481
+ current_user_permissions: UserScope;
223
482
  medal_expires?: string;
224
483
  };
484
+ type UserScope = number;
225
485
  type Net = {
226
- ip: string;
486
+ ip: string | null;
227
487
  port: number;
228
488
  domain: string;
229
489
  };
@@ -337,9 +597,9 @@ export declare namespace Archon {
337
597
  modloader: string;
338
598
  modloader_version: string;
339
599
  game_version: string;
340
- java_version: number;
341
- invocation: string;
342
- original_invocation: string;
600
+ java_version: number | null;
601
+ invocation: string | null;
602
+ original_invocation: string | null;
343
603
  };
344
604
  type Region = {
345
605
  shortcode: string;
@@ -409,27 +669,36 @@ export declare namespace Archon {
409
669
  type PostBackupQueueResponse = {
410
670
  id: string;
411
671
  };
672
+ type UserInfo = {
673
+ id: string;
674
+ username: string;
675
+ avatar_url: string | null;
676
+ };
412
677
  type DeleteManyBackupRequest = {
413
678
  backup_ids: string[];
414
679
  };
415
680
  type ActiveOperation = {
416
681
  backup_id: string;
417
682
  operation_type: BackupQueueOperationType;
418
- operation_id?: number | null;
683
+ operation_id: number | null;
419
684
  has_parent: boolean;
420
685
  scheduled_for: string;
686
+ started_at: string | null;
421
687
  synthetic_legacy: boolean;
688
+ user_info: UserInfo | null;
422
689
  };
423
690
  type BackupQueueOperation = {
424
691
  operation_type: BackupQueueOperationType;
425
- operation_id?: number | null;
692
+ operation_id: number | null;
426
693
  state: BackupQueueState;
427
694
  scheduled_for: string;
428
- completed_at?: string | null;
695
+ started_at: string | null;
696
+ completed_at: string | null;
429
697
  has_parent: boolean;
430
- error?: string | null;
698
+ error: string | null;
431
699
  should_prompt: boolean;
432
700
  synthetic_legacy: boolean;
701
+ user_info: UserInfo | null;
433
702
  };
434
703
  type BackupQueueBackup = {
435
704
  id: string;
@@ -446,6 +715,94 @@ export declare namespace Archon {
446
715
  };
447
716
  }
448
717
  }
718
+ namespace Sync {
719
+ namespace v1 {
720
+ type SyncCategory = 'backup' | 'users' | 'server' | 'protocol' | 'world';
721
+ type SyncIntent = 'all' | SyncCategory | SyncCategory[];
722
+ type BackupOperationStatus = 'completed' | 'cancelled' | 'failed' | 'timed-out';
723
+ type ServerNetworkPort = {
724
+ port: number;
725
+ name: string;
726
+ };
727
+ type ProtocolResetEvent = {
728
+ type: 'protocol.reset';
729
+ };
730
+ type ProtocolInvalidEvent = {
731
+ type: 'protocol.invalid';
732
+ };
733
+ type ProtocolErrorEvent = {
734
+ type: 'protocol.error';
735
+ error: string;
736
+ };
737
+ type BackupNewEvent = {
738
+ type: 'backup.new';
739
+ id: string;
740
+ };
741
+ type BackupPatchEvent = {
742
+ type: 'backup.patch';
743
+ world_id: string;
744
+ backup_id: string;
745
+ name: string;
746
+ };
747
+ type BackupDeleteEvent = {
748
+ type: 'backup.delete';
749
+ world_id: string;
750
+ backup_id: string;
751
+ };
752
+ type BackupOperationStartEvent = {
753
+ type: 'backup.operation.create.init' | 'backup.operation.create.start' | 'backup.operation.restore.init' | 'backup.operation.restore.start';
754
+ world_id: string;
755
+ backup_id: string;
756
+ operation_id: number;
757
+ };
758
+ type BackupOperationDoneEvent = {
759
+ type: 'backup.operation.create.done' | 'backup.operation.restore.done';
760
+ world_id: string;
761
+ backup_id: string;
762
+ operation_id: number;
763
+ status: BackupOperationStatus;
764
+ };
765
+ type ServerPatchEvent = {
766
+ type: 'server.patch';
767
+ name: string;
768
+ subdomain: string;
769
+ };
770
+ type ServerNetworkPatchEvent = {
771
+ type: 'server.network.patch';
772
+ ports: ServerNetworkPort[];
773
+ };
774
+ type ServerTransferEvent = {
775
+ type: 'server.transfer.start' | 'server.transfer.done';
776
+ target_node: string;
777
+ };
778
+ type UsersPatchEvent = {
779
+ type: 'users.patch';
780
+ };
781
+ type WorldPatchEvent = {
782
+ type: 'world.patch';
783
+ world_id: string;
784
+ name: string;
785
+ };
786
+ type WorldStartupPatchEvent = {
787
+ type: 'world.startup.patch';
788
+ world_id: string;
789
+ java_version: number | null;
790
+ invocation: string | null;
791
+ original_invocation: string | null;
792
+ };
793
+ type WorldContentAddonPatchEvent = {
794
+ type: 'world.content.addon.patch';
795
+ world_id: string;
796
+ specs: Archon.Content.v1.Addon[];
797
+ };
798
+ type WorldContentBaseUpdateEvent = {
799
+ type: 'world.content.base.update';
800
+ world_id: string;
801
+ spec: Archon.Content.v1.Addons;
802
+ };
803
+ type SyncEvent = ProtocolResetEvent | ProtocolInvalidEvent | ProtocolErrorEvent | BackupNewEvent | BackupPatchEvent | BackupDeleteEvent | BackupOperationStartEvent | BackupOperationDoneEvent | ServerPatchEvent | ServerNetworkPatchEvent | ServerTransferEvent | UsersPatchEvent | WorldPatchEvent | WorldStartupPatchEvent | WorldContentAddonPatchEvent | WorldContentBaseUpdateEvent;
804
+ }
805
+ }
449
806
  namespace Websocket {
450
807
  namespace v0 {
451
808
  type WSAuth = {
@@ -1,12 +1,17 @@
1
1
  import type { AbstractModrinthClient } from '../core/abstract-client';
2
2
  import type { AbstractModule } from '../core/abstract-module';
3
+ import { ArchonActionsV1Module } from './archon/actions/v1';
3
4
  import { ArchonBackupsV1Module } from './archon/backups/v1';
4
5
  import { ArchonBackupsQueueV1Module } from './archon/backups-queue/v1';
5
6
  import { ArchonContentV1Module } from './archon/content/v1';
7
+ import { ArchonNodesInternalModule } from './archon/nodes/internal';
8
+ import { ArchonNoticesV0Module } from './archon/notices/v0';
6
9
  import { ArchonOptionsV1Module } from './archon/options/v1';
7
10
  import { ArchonPropertiesV1Module } from './archon/properties/v1';
11
+ import { ArchonServerUsersV1Module } from './archon/server-users/v1';
8
12
  import { ArchonServersV0Module } from './archon/servers/v0';
9
13
  import { ArchonServersV1Module } from './archon/servers/v1';
14
+ import { ArchonTransfersInternalModule } from './archon/transfers/internal';
10
15
  import { ISO3166Module } from './iso3166';
11
16
  import { KyrosContentV1Module } from './kyros/content/v1';
12
17
  import { KyrosFilesV0Module } from './kyros/files/v0';
@@ -21,6 +26,7 @@ import { LabrinthBillingInternalModule } from './labrinth/billing/internal';
21
26
  import { LabrinthCampaignInternalModule } from './labrinth/campaign/internal';
22
27
  import { LabrinthCollectionsModule } from './labrinth/collections';
23
28
  import { LabrinthExternalProjectsInternalModule } from './labrinth/external-projects/internal';
29
+ import { LabrinthFriendsV3Module } from './labrinth/friends/v3';
24
30
  import { LabrinthGlobalsInternalModule } from './labrinth/globals/internal';
25
31
  import { LabrinthLimitsV3Module } from './labrinth/limits/v3';
26
32
  import { LabrinthModerationInternalModule } from './labrinth/moderation/internal';
@@ -59,13 +65,18 @@ type ModuleConstructor = new (client: AbstractModrinthClient) => AbstractModule;
59
65
  * TODO: Better way? Probably not
60
66
  */
61
67
  export declare const MODULE_REGISTRY: {
68
+ readonly archon_actions_v1: typeof ArchonActionsV1Module;
62
69
  readonly archon_backups_queue_v1: typeof ArchonBackupsQueueV1Module;
63
70
  readonly archon_backups_v1: typeof ArchonBackupsV1Module;
64
71
  readonly archon_content_v1: typeof ArchonContentV1Module;
72
+ readonly archon_nodes_internal: typeof ArchonNodesInternalModule;
73
+ readonly archon_notices_v0: typeof ArchonNoticesV0Module;
65
74
  readonly archon_options_v1: typeof ArchonOptionsV1Module;
66
75
  readonly archon_properties_v1: typeof ArchonPropertiesV1Module;
76
+ readonly archon_server_users_v1: typeof ArchonServerUsersV1Module;
67
77
  readonly archon_servers_v0: typeof ArchonServersV0Module;
68
78
  readonly archon_servers_v1: typeof ArchonServersV1Module;
79
+ readonly archon_transfers_internal: typeof ArchonTransfersInternalModule;
69
80
  readonly iso3166_data: typeof ISO3166Module;
70
81
  readonly mclogs_insights_v1: typeof MclogsInsightsV1Module;
71
82
  readonly mclogs_logs_v1: typeof MclogsLogsV1Module;
@@ -82,6 +93,7 @@ export declare const MODULE_REGISTRY: {
82
93
  readonly labrinth_campaign_internal: typeof LabrinthCampaignInternalModule;
83
94
  readonly labrinth_collections: typeof LabrinthCollectionsModule;
84
95
  readonly labrinth_external_projects_internal: typeof LabrinthExternalProjectsInternalModule;
96
+ readonly labrinth_friends_v3: typeof LabrinthFriendsV3Module;
85
97
  readonly labrinth_globals_internal: typeof LabrinthGlobalsInternalModule;
86
98
  readonly labrinth_moderation_internal: typeof LabrinthModerationInternalModule;
87
99
  readonly labrinth_notifications_v2: typeof LabrinthNotificationsV2Module;
@@ -0,0 +1,23 @@
1
+ import { AbstractModule } from '../../../core/abstract-module';
2
+ import type { Labrinth } from '../types';
3
+ export declare class LabrinthFriendsV3Module extends AbstractModule {
4
+ getModuleID(): string;
5
+ /**
6
+ * Get friends and pending friend requests for the authenticated user
7
+ *
8
+ * @returns Promise resolving to friend relationships
9
+ */
10
+ list(): Promise<Labrinth.Friends.v3.UserFriend[]>;
11
+ /**
12
+ * Send or accept a friend request
13
+ *
14
+ * @param idOrUsername - The target user's ID or username
15
+ */
16
+ add(idOrUsername: string): Promise<void>;
17
+ /**
18
+ * Remove a friend or pending friend request
19
+ *
20
+ * @param idOrUsername - The target user's ID or username
21
+ */
22
+ remove(idOrUsername: string): Promise<void>;
23
+ }
@@ -4,6 +4,7 @@ export * from './auth/v2';
4
4
  export * from './billing/internal';
5
5
  export * from './collections';
6
6
  export * from './external-projects/internal';
7
+ export * from './friends/v3';
7
8
  export * from './globals/internal';
8
9
  export * from './limits/v3';
9
10
  export * from './moderation/internal';
@@ -1124,12 +1124,27 @@ export declare namespace Labrinth {
1124
1124
  moderation_notes?: Common.ModerationNote | null;
1125
1125
  github_id?: number;
1126
1126
  };
1127
+ type SearchUser = {
1128
+ id: string;
1129
+ username: string;
1130
+ avatar_url: string | null;
1131
+ };
1127
1132
  type AllProjectsResponse = {
1128
1133
  projects: Projects.v3.Project[];
1129
1134
  organizations: Record<string, Organizations.v3.Organization>;
1130
1135
  };
1131
1136
  }
1132
1137
  }
1138
+ namespace Friends {
1139
+ namespace v3 {
1140
+ type UserFriend = {
1141
+ id: string;
1142
+ friend_id: string;
1143
+ accepted: boolean;
1144
+ created: string;
1145
+ };
1146
+ }
1147
+ }
1133
1148
  namespace ServerPing {
1134
1149
  namespace Internal {
1135
1150
  type MinecraftJavaPingRequest = {
@@ -16,6 +16,15 @@ export declare class LabrinthUsersV3Module extends AbstractModule {
16
16
  * GET /v3/user/{id}
17
17
  */
18
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[]>;
19
28
  /**
20
29
  * Get all projects the authenticated user can access directly or through
21
30
  * their organizations.
@@ -1,4 +1,4 @@
1
- import type { ModrinthApiError } from '../core/errors';
1
+ import { ModrinthApiError } from '../core/errors';
2
2
  import type { ClientConfig } from '../types/client';
3
3
  import type { RequestOptions } from '../types/request';
4
4
  import { XHRUploadClient } from './xhr-upload-client';
@@ -23,5 +23,6 @@ import { XHRUploadClient } from './xhr-upload-client';
23
23
  export declare class GenericModrinthClient extends XHRUploadClient {
24
24
  constructor(config: ClientConfig);
25
25
  protected executeRequest<T>(url: string, options: RequestOptions): Promise<T>;
26
+ protected executeStreamRequest(url: string, options: RequestOptions): Promise<ReadableStream<Uint8Array>>;
26
27
  protected normalizeError(error: unknown): ModrinthApiError;
27
28
  }
@@ -82,6 +82,7 @@ export declare class NuxtModrinthClient extends XHRUploadClient {
82
82
  */
83
83
  upload<T = void>(path: string, options: UploadRequestOptions): UploadHandle<T>;
84
84
  protected executeRequest<T>(url: string, options: RequestOptions): Promise<T>;
85
+ protected executeStreamRequest(url: string, options: RequestOptions): Promise<ReadableStream<Uint8Array>>;
85
86
  protected normalizeError(error: unknown): ModrinthApiError;
86
87
  protected buildDefaultHeaders(): Promise<Record<string, string>>;
87
88
  }
@@ -0,0 +1,16 @@
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
+ }
@@ -30,5 +30,6 @@ export declare class TauriModrinthClient extends XHRUploadClient {
30
30
  protected config: TauriClientConfig;
31
31
  constructor(config: TauriClientConfig);
32
32
  protected executeRequest<T>(url: string, options: RequestOptions): Promise<T>;
33
+ protected executeStreamRequest(url: string, options: RequestOptions): Promise<ReadableStream<Uint8Array>>;
33
34
  protected normalizeError(error: unknown): ModrinthApiError;
34
35
  }