@modrinth/api-client 0.89.0 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2306,6 +2306,9 @@ export declare namespace Kyros {
2306
2306
  }
2307
2307
  export namespace Files {
2308
2308
  export namespace v1 {
2309
+ export interface FileDownloadAuthorization {
2310
+ token: string;
2311
+ }
2309
2312
  export interface FullWorldDownloadAuthorization {
2310
2313
  token: string;
2311
2314
  }
@@ -2502,6 +2505,14 @@ declare class KyrosFilesV0Module extends AbstractModule {
2502
2505
 
2503
2506
  declare class KyrosFilesV1Module extends AbstractModule {
2504
2507
  getModuleID(): string;
2508
+ /**
2509
+ * Authorize a short-lived, single-use file download.
2510
+ */
2511
+ authorizeFileDownload(nodeUrlHost: string, worldId: string, path: string): Promise<Kyros.Files.v1.FileDownloadAuthorization>;
2512
+ /**
2513
+ * Build the browser URL for a previously authorized file download.
2514
+ */
2515
+ getFileDownloadUrl(nodeUrlHost: string, worldId: string, token: string): string;
2505
2516
  /**
2506
2517
  * Authorize a short-lived, single-use full-world download.
2507
2518
  */
@@ -3458,6 +3469,7 @@ export declare namespace Labrinth {
3458
3469
  export type ProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader' | 'plugin' | 'datapack';
3459
3470
  export type Environment = 'client_and_server' | 'client_only' | 'client_only_server_optional' | 'singleplayer_only' | 'server_only' | 'server_only_client_optional' | 'dedicated_server_only' | 'client_or_server' | 'client_or_server_prefers_both' | 'unknown';
3460
3471
  export type GalleryItem = {
3472
+ id?: number;
3461
3473
  url: string;
3462
3474
  raw_url: string;
3463
3475
  featured: boolean;
@@ -3609,7 +3621,7 @@ export declare namespace Labrinth {
3609
3621
  side_types_migration_review_status?: 'reviewed' | 'pending';
3610
3622
  environment?: Environment;
3611
3623
  minecraft_server?: MinecraftServer;
3612
- minecraft_java_server?: MinecraftJavaServer;
3624
+ minecraft_java_server?: Omit<MinecraftJavaServer, 'ping'>;
3613
3625
  minecraft_bedrock_server?: MinecraftBedrockServer;
3614
3626
  [key: string]: unknown;
3615
3627
  };
@@ -4264,6 +4276,235 @@ export declare namespace Labrinth {
4264
4276
  export namespace Threads {
4265
4277
  export namespace v3 {
4266
4278
  export type ThreadType = 'report' | 'project' | 'direct_message';
4279
+ export type TextTarget = {
4280
+ original: string;
4281
+ suggestion?: string | null;
4282
+ };
4283
+ export type OptionalTextTarget = {
4284
+ original?: string | null;
4285
+ /** Omitted means no suggestion; null suggests removing the value. */
4286
+ suggestion?: string | null;
4287
+ };
4288
+ export type DisclosureMetadata<T extends Projects.v3.ProjectDisclosureType> = Omit<Extract<Projects.v3.ProjectDisclosure, {
4289
+ type: T;
4290
+ }>, 'type'>;
4291
+ export type DisclosureMetadataTarget<T extends Projects.v3.ProjectDisclosureType> = {
4292
+ original: DisclosureMetadata<T> | null;
4293
+ suggestion?: DisclosureMetadata<T> | null;
4294
+ };
4295
+ export type ModifyDisclosureTarget = {
4296
+ [T in Projects.v3.ProjectDisclosureType]: {
4297
+ type: 'modify_project_disclosure';
4298
+ value: {
4299
+ disclosure_type: T;
4300
+ metadata: DisclosureMetadataTarget<T>;
4301
+ };
4302
+ };
4303
+ }[Projects.v3.ProjectDisclosureType];
4304
+ export type VersionIssueTarget = {
4305
+ type: 'remove';
4306
+ } | {
4307
+ type: 'modify_environment';
4308
+ value: TextTarget;
4309
+ } | {
4310
+ type: 'modify_game_versions';
4311
+ value: {
4312
+ original: string[];
4313
+ suggestion?: string[] | null;
4314
+ };
4315
+ } | {
4316
+ type: 'modify_dependencies';
4317
+ value: {
4318
+ original: Versions.v3.Dependency[];
4319
+ suggestion?: Versions.v3.Dependency[] | null;
4320
+ };
4321
+ } | {
4322
+ type: 'modify_changelog';
4323
+ value: TextTarget;
4324
+ } | {
4325
+ type: 'remove_additional_files';
4326
+ value: {
4327
+ file_ids: string[];
4328
+ };
4329
+ } | {
4330
+ type: 'modify_additional_file_type';
4331
+ value: {
4332
+ file_id: string;
4333
+ filename: string;
4334
+ original?: Versions.v3.FileType | null;
4335
+ suggestion?: Versions.v3.FileType | null;
4336
+ };
4337
+ };
4338
+ export type ThreadIssueTarget = {
4339
+ type: 'mark_addressed';
4340
+ } | {
4341
+ type: 'modify_title';
4342
+ value: TextTarget;
4343
+ } | {
4344
+ type: 'modify_slug';
4345
+ value: TextTarget;
4346
+ } | {
4347
+ type: 'modify_summary';
4348
+ value: TextTarget;
4349
+ } | {
4350
+ type: 'modify_description';
4351
+ value: TextTarget;
4352
+ } | {
4353
+ type: 'modify_license';
4354
+ value: {
4355
+ license: TextTarget;
4356
+ url: TextTarget;
4357
+ };
4358
+ } | {
4359
+ type: 'modify_icon';
4360
+ value: {
4361
+ original_url: string | null;
4362
+ };
4363
+ } | {
4364
+ type: 'remove_icon';
4365
+ } | {
4366
+ type: 'remove_tags';
4367
+ value: {
4368
+ tags: string[];
4369
+ };
4370
+ } | {
4371
+ type: 'modify_links';
4372
+ value: {
4373
+ links: Record<string, TextTarget>;
4374
+ };
4375
+ } | {
4376
+ type: 'add_gallery_images';
4377
+ value: {
4378
+ original_image_ids: number[];
4379
+ auto_resolve: boolean;
4380
+ };
4381
+ } | {
4382
+ type: 'modify_gallery_image';
4383
+ value: {
4384
+ image_id: number;
4385
+ original_url: string;
4386
+ name?: OptionalTextTarget | null;
4387
+ description?: OptionalTextTarget | null;
4388
+ };
4389
+ } | {
4390
+ type: 'remove_gallery_images';
4391
+ value: {
4392
+ image_ids: number[];
4393
+ original_images?: {
4394
+ id: number;
4395
+ url: string;
4396
+ name?: string;
4397
+ }[];
4398
+ };
4399
+ } | {
4400
+ type: 'add_project_disclosures';
4401
+ value: {
4402
+ disclosure_types: string[];
4403
+ };
4404
+ } | {
4405
+ type: 'remove_project_disclosures';
4406
+ value: {
4407
+ disclosure_types: string[];
4408
+ };
4409
+ } | ModifyDisclosureTarget | {
4410
+ type: 'modify_project_disclosure_note';
4411
+ value: {
4412
+ disclosure_type: string;
4413
+ note: OptionalTextTarget;
4414
+ };
4415
+ } | {
4416
+ type: 'version';
4417
+ value: {
4418
+ version_id: string;
4419
+ version_number: string;
4420
+ target: VersionIssueTarget;
4421
+ };
4422
+ } | {
4423
+ type: 'modify_team_member_role';
4424
+ value: {
4425
+ team_id: string;
4426
+ user_id: string;
4427
+ role: TextTarget;
4428
+ };
4429
+ } | {
4430
+ type: 'modify_server_languages';
4431
+ value: {
4432
+ original: string[];
4433
+ suggestion?: string[] | null;
4434
+ };
4435
+ } | {
4436
+ type: 'modify_server_address';
4437
+ value: {
4438
+ platform: 'minecraft_java' | 'minecraft_bedrock';
4439
+ address: TextTarget;
4440
+ };
4441
+ } | {
4442
+ type: 'acknowledge';
4443
+ value: {
4444
+ mode: 'checkbox' | 'reply';
4445
+ };
4446
+ };
4447
+ export type NewThreadIssueFacet = {
4448
+ what: ThreadIssueTarget;
4449
+ };
4450
+ export type ThreadIssueLocation = {
4451
+ field: 'title' | 'slug' | 'summary' | 'icon' | 'description' | 'license' | 'tags' | 'links' | 'gallery' | 'disclosures' | 'versions' | 'members' | 'server' | 'permissions';
4452
+ label?: {
4453
+ id: string;
4454
+ defaultMessage?: string;
4455
+ };
4456
+ };
4457
+ /**
4458
+ * The backend stores `why` as an arbitrary JSON blob; this schema is interpreted by the frontend.
4459
+ * Fields are optional to support issues created before review metadata was added.
4460
+ */
4461
+ export type ThreadIssueWhy = {
4462
+ issue_id?: string;
4463
+ /**
4464
+ * this is to indicate where to show issue card if the issue facet(action) does not have a specific location.
4465
+ */
4466
+ locations?: ThreadIssueLocation[];
4467
+ title?: string;
4468
+ message?: string;
4469
+ custom?: {
4470
+ priority: string;
4471
+ };
4472
+ /**
4473
+ * this is the state of the issue, at creation time.used for re - rev
4474
+ */
4475
+ selection?: {
4476
+ toggle_ids: string[];
4477
+ text_values: Record<string, string>;
4478
+ select_values: Record<string, string[]>;
4479
+ };
4480
+ };
4481
+ export type NewThreadIssue = {
4482
+ why: ThreadIssueWhy;
4483
+ facets: [NewThreadIssueFacet, ...NewThreadIssueFacet[]];
4484
+ };
4485
+ export type NewThreadIssues = {
4486
+ issues: [NewThreadIssue, ...NewThreadIssue[]];
4487
+ };
4488
+ export type ThreadIssueVerdict = 'open' | 'addressed' | 'resolved';
4489
+ export type ThreadIssueFacet = {
4490
+ id: string;
4491
+ what: ThreadIssueTarget;
4492
+ user_addressed: boolean;
4493
+ moderator_verified: boolean;
4494
+ verdict: ThreadIssueVerdict;
4495
+ };
4496
+ export type ThreadIssue = {
4497
+ id: string;
4498
+ created_by: string | null;
4499
+ created_at: string;
4500
+ why: ThreadIssueWhy;
4501
+ facets: ThreadIssueFacet[];
4502
+ verdict: ThreadIssueVerdict;
4503
+ };
4504
+ export type EditThreadIssueFacet = {
4505
+ user_addressed?: boolean;
4506
+ moderator_verified?: boolean;
4507
+ };
4267
4508
  export type MessageBody = {
4268
4509
  type: 'text';
4269
4510
  body: string;
@@ -4274,6 +4515,10 @@ export declare namespace Labrinth {
4274
4515
  type: 'status_change';
4275
4516
  new_status: Projects.v2.ProjectStatus;
4276
4517
  old_status: Projects.v2.ProjectStatus;
4518
+ } | {
4519
+ type: 'auto_approval';
4520
+ new_status: Projects.v2.ProjectStatus;
4521
+ old_status: Projects.v2.ProjectStatus;
4277
4522
  } | {
4278
4523
  type: 'tech_review';
4279
4524
  verdict: 'safe' | 'unsafe';
@@ -4313,6 +4558,7 @@ export declare namespace Labrinth {
4313
4558
  project_id: string | null;
4314
4559
  report_id: string | null;
4315
4560
  messages: ThreadMessage[];
4561
+ issues: ThreadIssue[];
4316
4562
  members: ThreadMember[];
4317
4563
  };
4318
4564
  export type SendMessageRequest = {
@@ -4593,6 +4839,13 @@ export declare namespace Labrinth {
4593
4839
  }
4594
4840
  export namespace TechReview {
4595
4841
  export namespace Internal {
4842
+ export type FlaggedProject = {
4843
+ project_id: string;
4844
+ thread_id: string;
4845
+ status: Projects.v3.Project['status'];
4846
+ message_id: string;
4847
+ reviewed: string;
4848
+ };
4596
4849
  export type DelphiRule = {
4597
4850
  id: number;
4598
4851
  name: string;
@@ -5468,7 +5721,7 @@ declare class LabrinthModerationInternalModule extends AbstractModule {
5468
5721
  getProjectIds(params?: Omit<Labrinth.Moderation.Internal.ProjectsRequest, 'count' | 'offset'>): Promise<Labrinth.Moderation.Internal.ProjectIdsResponse>;
5469
5722
  acquireLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
5470
5723
  overrideLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
5471
- releaseLock(projectId: string): Promise<Labrinth.Moderation.Internal.ReleaseLockResponse>;
5724
+ releaseLock(projectId: string, token?: string): Promise<Labrinth.Moderation.Internal.ReleaseLockResponse>;
5472
5725
  checkLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockStatusResponse>;
5473
5726
  lockUser(userId: string, reason: string): Promise<void>;
5474
5727
  unlockUser(userId: string): Promise<void>;
@@ -6430,6 +6683,8 @@ declare class LabrinthTechReviewInternalModule extends AbstractModule {
6430
6683
  * @returns The project report (may be null if no reports exist) and the moderation thread
6431
6684
  */
6432
6685
  getProjectReport(projectId: string): Promise<Labrinth.TechReview.Internal.ProjectReportResponse>;
6686
+ getUsersFlaggedProjects(userIds: string[]): Promise<Record<string, Labrinth.TechReview.Internal.FlaggedProject[]>>;
6687
+ getOrganizationFlaggedProjects(organizationId: string): Promise<Labrinth.TechReview.Internal.FlaggedProject[]>;
6433
6688
  }
6434
6689
 
6435
6690
  declare class LabrinthThreadsV3Module extends AbstractModule {
@@ -6474,6 +6729,14 @@ declare class LabrinthThreadsV3Module extends AbstractModule {
6474
6729
  * ```
6475
6730
  */
6476
6731
  sendMessage(id: string, message: Labrinth.Threads.v3.SendMessageRequest): Promise<void>;
6732
+ /** Create moderation issues in a thread (requires THREAD_WRITE scope). */
6733
+ createIssues(id: string, data: Labrinth.Threads.v3.NewThreadIssues): Promise<void>;
6734
+ /** Update a thread issue facet's addressed or verified state. */
6735
+ editIssueFacet(id: string, data: Labrinth.Threads.v3.EditThreadIssueFacet): Promise<void>;
6736
+ /** Mark a thread issue facet as addressed by the project member. */
6737
+ user_addressed(facetId: string): Promise<void>;
6738
+ /** Mark a thread issue facet as verified by a moderator. */
6739
+ moderator_verified(facetId: string): Promise<void>;
6477
6740
  /**
6478
6741
  * Delete a message from a thread (v3)
6479
6742
  *