@modrinth/api-client 0.90.0 → 0.92.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 +255 -2
- package/dist/index.js +5 -5
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3469,6 +3469,7 @@ export declare namespace Labrinth {
|
|
|
3469
3469
|
export type ProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader' | 'plugin' | 'datapack';
|
|
3470
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';
|
|
3471
3471
|
export type GalleryItem = {
|
|
3472
|
+
id?: number;
|
|
3472
3473
|
url: string;
|
|
3473
3474
|
raw_url: string;
|
|
3474
3475
|
featured: boolean;
|
|
@@ -3620,7 +3621,7 @@ export declare namespace Labrinth {
|
|
|
3620
3621
|
side_types_migration_review_status?: 'reviewed' | 'pending';
|
|
3621
3622
|
environment?: Environment;
|
|
3622
3623
|
minecraft_server?: MinecraftServer;
|
|
3623
|
-
minecraft_java_server?: MinecraftJavaServer
|
|
3624
|
+
minecraft_java_server?: Omit<MinecraftJavaServer, 'ping'>;
|
|
3624
3625
|
minecraft_bedrock_server?: MinecraftBedrockServer;
|
|
3625
3626
|
[key: string]: unknown;
|
|
3626
3627
|
};
|
|
@@ -4275,6 +4276,235 @@ export declare namespace Labrinth {
|
|
|
4275
4276
|
export namespace Threads {
|
|
4276
4277
|
export namespace v3 {
|
|
4277
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
|
+
};
|
|
4278
4508
|
export type MessageBody = {
|
|
4279
4509
|
type: 'text';
|
|
4280
4510
|
body: string;
|
|
@@ -4285,6 +4515,10 @@ export declare namespace Labrinth {
|
|
|
4285
4515
|
type: 'status_change';
|
|
4286
4516
|
new_status: Projects.v2.ProjectStatus;
|
|
4287
4517
|
old_status: Projects.v2.ProjectStatus;
|
|
4518
|
+
} | {
|
|
4519
|
+
type: 'auto_approval';
|
|
4520
|
+
new_status: Projects.v2.ProjectStatus;
|
|
4521
|
+
old_status: Projects.v2.ProjectStatus;
|
|
4288
4522
|
} | {
|
|
4289
4523
|
type: 'tech_review';
|
|
4290
4524
|
verdict: 'safe' | 'unsafe';
|
|
@@ -4324,6 +4558,7 @@ export declare namespace Labrinth {
|
|
|
4324
4558
|
project_id: string | null;
|
|
4325
4559
|
report_id: string | null;
|
|
4326
4560
|
messages: ThreadMessage[];
|
|
4561
|
+
issues: ThreadIssue[];
|
|
4327
4562
|
members: ThreadMember[];
|
|
4328
4563
|
};
|
|
4329
4564
|
export type SendMessageRequest = {
|
|
@@ -4556,6 +4791,7 @@ export declare namespace Labrinth {
|
|
|
4556
4791
|
homePageProjects?: Projects.v2.Project[];
|
|
4557
4792
|
homePageSearch?: Search.v2.SearchResults;
|
|
4558
4793
|
homePageNotifs?: Search.v2.SearchResults;
|
|
4794
|
+
prideProjectIds?: string[];
|
|
4559
4795
|
products?: Billing.Internal.Product[];
|
|
4560
4796
|
countries: ISO3166.Country[];
|
|
4561
4797
|
subdivisions: Record<string, ISO3166.Subdivision[]>;
|
|
@@ -4604,6 +4840,13 @@ export declare namespace Labrinth {
|
|
|
4604
4840
|
}
|
|
4605
4841
|
export namespace TechReview {
|
|
4606
4842
|
export namespace Internal {
|
|
4843
|
+
export type FlaggedProject = {
|
|
4844
|
+
project_id: string;
|
|
4845
|
+
thread_id: string;
|
|
4846
|
+
status: Projects.v3.Project['status'];
|
|
4847
|
+
message_id: string;
|
|
4848
|
+
reviewed: string;
|
|
4849
|
+
};
|
|
4607
4850
|
export type DelphiRule = {
|
|
4608
4851
|
id: number;
|
|
4609
4852
|
name: string;
|
|
@@ -5479,7 +5722,7 @@ declare class LabrinthModerationInternalModule extends AbstractModule {
|
|
|
5479
5722
|
getProjectIds(params?: Omit<Labrinth.Moderation.Internal.ProjectsRequest, 'count' | 'offset'>): Promise<Labrinth.Moderation.Internal.ProjectIdsResponse>;
|
|
5480
5723
|
acquireLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
|
|
5481
5724
|
overrideLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
|
|
5482
|
-
releaseLock(projectId: string): Promise<Labrinth.Moderation.Internal.ReleaseLockResponse>;
|
|
5725
|
+
releaseLock(projectId: string, token?: string): Promise<Labrinth.Moderation.Internal.ReleaseLockResponse>;
|
|
5483
5726
|
checkLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockStatusResponse>;
|
|
5484
5727
|
lockUser(userId: string, reason: string): Promise<void>;
|
|
5485
5728
|
unlockUser(userId: string): Promise<void>;
|
|
@@ -6441,6 +6684,8 @@ declare class LabrinthTechReviewInternalModule extends AbstractModule {
|
|
|
6441
6684
|
* @returns The project report (may be null if no reports exist) and the moderation thread
|
|
6442
6685
|
*/
|
|
6443
6686
|
getProjectReport(projectId: string): Promise<Labrinth.TechReview.Internal.ProjectReportResponse>;
|
|
6687
|
+
getUsersFlaggedProjects(userIds: string[]): Promise<Record<string, Labrinth.TechReview.Internal.FlaggedProject[]>>;
|
|
6688
|
+
getOrganizationFlaggedProjects(organizationId: string): Promise<Labrinth.TechReview.Internal.FlaggedProject[]>;
|
|
6444
6689
|
}
|
|
6445
6690
|
|
|
6446
6691
|
declare class LabrinthThreadsV3Module extends AbstractModule {
|
|
@@ -6485,6 +6730,14 @@ declare class LabrinthThreadsV3Module extends AbstractModule {
|
|
|
6485
6730
|
* ```
|
|
6486
6731
|
*/
|
|
6487
6732
|
sendMessage(id: string, message: Labrinth.Threads.v3.SendMessageRequest): Promise<void>;
|
|
6733
|
+
/** Create moderation issues in a thread (requires THREAD_WRITE scope). */
|
|
6734
|
+
createIssues(id: string, data: Labrinth.Threads.v3.NewThreadIssues): Promise<void>;
|
|
6735
|
+
/** Update a thread issue facet's addressed or verified state. */
|
|
6736
|
+
editIssueFacet(id: string, data: Labrinth.Threads.v3.EditThreadIssueFacet): Promise<void>;
|
|
6737
|
+
/** Mark a thread issue facet as addressed by the project member. */
|
|
6738
|
+
user_addressed(facetId: string): Promise<void>;
|
|
6739
|
+
/** Mark a thread issue facet as verified by a moderator. */
|
|
6740
|
+
moderator_verified(facetId: string): Promise<void>;
|
|
6488
6741
|
/**
|
|
6489
6742
|
* Delete a message from a thread (v3)
|
|
6490
6743
|
*
|