@modrinth/api-client 0.62.0 → 0.64.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
@@ -2258,6 +2258,34 @@ export declare namespace Kyros {
2258
2258
  }
2259
2259
  }
2260
2260
  export namespace Files {
2261
+ export namespace v1 {
2262
+ export type DescendantType = 'regular' | 'directory' | 'symlink' | 'other';
2263
+ export interface FileStatRequest {
2264
+ path: string;
2265
+ }
2266
+ export interface FileStatResponse {
2267
+ name: string;
2268
+ full_path: string;
2269
+ size_bytes: number;
2270
+ type: DescendantType;
2271
+ mtime: string;
2272
+ ctime: string;
2273
+ }
2274
+ export type ZipRequest = {
2275
+ target_type: 'Directory';
2276
+ path: string;
2277
+ } | {
2278
+ target_type: 'ManyPaths';
2279
+ parent: string;
2280
+ include: string[];
2281
+ target: string;
2282
+ };
2283
+ export interface ZipProgress {
2284
+ progress: number;
2285
+ done?: boolean;
2286
+ error?: string;
2287
+ }
2288
+ }
2261
2289
  export namespace v0 {
2262
2290
  export interface DirectoryItem {
2263
2291
  name: string;
@@ -2407,9 +2435,10 @@ declare class KyrosFilesV0Module extends AbstractModule {
2407
2435
  * @param path - Path to archive file
2408
2436
  * @param override - If true, overwrite existing files
2409
2437
  * @param dry - If true, perform dry run (returns conflicts without extracting)
2438
+ * @param target - Directory to extract the archive into
2410
2439
  * @returns Extract result with modpack name and conflicting files
2411
2440
  */
2412
- extractFile(path: string, override?: boolean, dry?: boolean): Promise<Kyros.Files.v0.ExtractResult>;
2441
+ extractFile(path: string, override?: boolean, dry?: boolean, target?: string): Promise<Kyros.Files.v0.ExtractResult>;
2413
2442
  /**
2414
2443
  * Modify a filesystem operation (dismiss or cancel)
2415
2444
  *
@@ -2421,6 +2450,18 @@ declare class KyrosFilesV0Module extends AbstractModule {
2421
2450
  modifyOperation(opId: string, action: 'dismiss' | 'cancel'): Promise<void>;
2422
2451
  }
2423
2452
 
2453
+ declare class KyrosFilesV1Module extends AbstractModule {
2454
+ getModuleID(): string;
2455
+ /**
2456
+ * Get metadata for a path in world storage.
2457
+ */
2458
+ stat(worldId: string, data: Kyros.Files.v1.FileStatRequest): Promise<Kyros.Files.v1.FileStatResponse>;
2459
+ /**
2460
+ * Create a ZIP archive beside a directory in world storage.
2461
+ */
2462
+ createZip(worldId: string, data: Kyros.Files.v1.ZipRequest, onProgress?: (record: Kyros.Files.v1.ZipProgress) => void): Promise<void>;
2463
+ }
2464
+
2424
2465
  declare class KyrosLogsV1Module extends AbstractModule {
2425
2466
  getModuleID(): string;
2426
2467
  /** POST /v1/logs/clear — clear the live logs buffer for the current server */
@@ -4458,6 +4499,110 @@ export declare namespace Labrinth {
4458
4499
  }
4459
4500
  export namespace TechReview {
4460
4501
  export namespace Internal {
4502
+ export type DelphiRule = {
4503
+ id: number;
4504
+ name: string;
4505
+ rule: string;
4506
+ priority: number;
4507
+ on_issue_types: string[];
4508
+ revision: number;
4509
+ current_revision?: number;
4510
+ created_at: string;
4511
+ updated_at: string;
4512
+ created_by: number | null;
4513
+ updated_by: number | null;
4514
+ affected_details_count: number;
4515
+ affected_details: DelphiRuleAffectedDetail[];
4516
+ };
4517
+ export type DelphiRuleAffectedDetail = {
4518
+ detail_id: string;
4519
+ issue_id: string;
4520
+ project_id: string | null;
4521
+ project_name: string | null;
4522
+ project_icon_url: string | null;
4523
+ version_id: string | null;
4524
+ version_name: string | null;
4525
+ version_number: string | null;
4526
+ issue_type: string;
4527
+ key: string;
4528
+ jar: string | null;
4529
+ file_path: string;
4530
+ original_severity: DelphiSeverity;
4531
+ severity: DelphiSeverity;
4532
+ };
4533
+ export type GetRuleAffectedDetailsRequest = {
4534
+ limit?: number;
4535
+ page?: number;
4536
+ };
4537
+ export type GetRuleAffectedDetailsResponse = {
4538
+ total: number;
4539
+ details: DelphiRuleAffectedDetail[];
4540
+ };
4541
+ export type WriteDelphiRule = {
4542
+ name: string;
4543
+ rule: string;
4544
+ priority: number;
4545
+ on_issue_types: string[];
4546
+ };
4547
+ export type DelphiIssueTypeSchemaResponse = Record<string, unknown>;
4548
+ export type TestDelphiRuleRequest = {
4549
+ rule: string;
4550
+ inputs: RuleInput[];
4551
+ };
4552
+ export type DelphiRuleEffect = {
4553
+ severity: DelphiSeverity;
4554
+ };
4555
+ export type DelphiRuleSchema = Record<string, unknown>;
4556
+ export type DelphiRuleSchemaResponse = {
4557
+ input: DelphiRuleSchema;
4558
+ output: DelphiRuleSchema;
4559
+ components: Record<string, DelphiRuleSchema>;
4560
+ };
4561
+ export type RuleInput = {
4562
+ schema_version: number;
4563
+ trace: RuleTrace;
4564
+ file_traces: RuleTrace[];
4565
+ scan: {
4566
+ delphi_version: number;
4567
+ };
4568
+ artifact: {
4569
+ size: number | null;
4570
+ hashes: Record<string, string>;
4571
+ };
4572
+ project: {
4573
+ id: string | null;
4574
+ types: string[];
4575
+ };
4576
+ version: {
4577
+ id: string | null;
4578
+ loaders: string[];
4579
+ };
4580
+ file: {
4581
+ id: string | null;
4582
+ };
4583
+ };
4584
+ export type RuleTrace = {
4585
+ key: string;
4586
+ issue_type: string;
4587
+ severity: DelphiSeverity;
4588
+ jar: string | null;
4589
+ file_path: string;
4590
+ data: Record<string, unknown>;
4591
+ };
4592
+ export type TestDelphiRuleResponse = {
4593
+ effects: Array<DelphiRuleEffect | null>;
4594
+ };
4595
+ export type DelphiRuleScanPhase = 'scanning' | 'publishing' | 'complete';
4596
+ export type DelphiRuleScanEvent = {
4597
+ phase: DelphiRuleScanPhase;
4598
+ revision: number;
4599
+ scanned: number;
4600
+ total: number;
4601
+ effects: number;
4602
+ };
4603
+ export type DelphiRuleScanErrorEvent = {
4604
+ message: string;
4605
+ };
4461
4606
  export type SearchProjectsRequest = {
4462
4607
  limit?: number;
4463
4608
  page?: number;
@@ -4561,6 +4706,9 @@ export declare namespace Labrinth {
4561
4706
  download_url: string;
4562
4707
  issues: FileIssue[];
4563
4708
  };
4709
+ export type GetIssueRequest = {
4710
+ include_hidden?: boolean;
4711
+ };
4564
4712
  export type FileIssue = {
4565
4713
  id: string;
4566
4714
  report_id: string;
@@ -4660,7 +4808,7 @@ export declare namespace Labrinth {
4660
4808
  members: User[];
4661
4809
  };
4662
4810
  export type FlagReason = 'delphi';
4663
- export type DelphiSeverity = 'low' | 'medium' | 'high' | 'severe';
4811
+ export type DelphiSeverity = 'hidden' | 'low' | 'medium' | 'high' | 'severe' | 'malware';
4664
4812
  export type DelphiReportIssueStatus = 'pending' | 'safe' | 'unsafe';
4665
4813
  export type ProjectReportResponse = {
4666
4814
  project_report: ProjectReport | null;
@@ -6096,6 +6244,16 @@ declare class LabrinthTeamsV3Module extends AbstractModule {
6096
6244
 
6097
6245
  declare class LabrinthTechReviewInternalModule extends AbstractModule {
6098
6246
  getModuleID(): string;
6247
+ getRules(): Promise<Labrinth.TechReview.Internal.DelphiRule[]>;
6248
+ getRuleSchema(): Promise<Labrinth.TechReview.Internal.DelphiRuleSchemaResponse>;
6249
+ getIssueTypeSchema(): Promise<Labrinth.TechReview.Internal.DelphiIssueTypeSchemaResponse>;
6250
+ getDetailRuleInput(detailId: string): Promise<Labrinth.TechReview.Internal.RuleInput>;
6251
+ getRuleAffectedDetails(id: number, params?: Labrinth.TechReview.Internal.GetRuleAffectedDetailsRequest): Promise<Labrinth.TechReview.Internal.GetRuleAffectedDetailsResponse>;
6252
+ testRule(request: Labrinth.TechReview.Internal.TestDelphiRuleRequest): Promise<Labrinth.TechReview.Internal.TestDelphiRuleResponse>;
6253
+ createRule(rule: Labrinth.TechReview.Internal.WriteDelphiRule): Promise<Labrinth.TechReview.Internal.DelphiRule>;
6254
+ updateRule(id: number, rule: Labrinth.TechReview.Internal.WriteDelphiRule): Promise<Labrinth.TechReview.Internal.DelphiRule>;
6255
+ deleteRule(id: number): Promise<void>;
6256
+ scanRules(signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
6099
6257
  /**
6100
6258
  * Search for projects awaiting technical review.
6101
6259
  *
@@ -6137,6 +6295,7 @@ declare class LabrinthTechReviewInternalModule extends AbstractModule {
6137
6295
  * Get detailed information about a specific issue.
6138
6296
  *
6139
6297
  * @param issueId - The issue ID
6298
+ * @param params - Options controlling which issue details are returned
6140
6299
  * @returns Issue with all its details
6141
6300
  *
6142
6301
  * @example
@@ -6145,7 +6304,7 @@ declare class LabrinthTechReviewInternalModule extends AbstractModule {
6145
6304
  * console.log(issue.issue_type, issue.status)
6146
6305
  * ```
6147
6306
  */
6148
- getIssue(issueId: string): Promise<Labrinth.TechReview.Internal.FileIssue>;
6307
+ getIssue(issueId: string, params?: Labrinth.TechReview.Internal.GetIssueRequest): Promise<Labrinth.TechReview.Internal.FileIssue>;
6149
6308
  /**
6150
6309
  * Update the status of a technical review issue detail.
6151
6310
  *
@@ -6767,6 +6926,10 @@ export declare type ModrinthErrorResponse = {
6767
6926
  * Human-readable error description
6768
6927
  */
6769
6928
  description: string;
6929
+ /**
6930
+ * Structured details about the error
6931
+ */
6932
+ details?: unknown;
6770
6933
  /**
6771
6934
  * Optional context about where the error occurred
6772
6935
  */
@@ -6824,6 +6987,7 @@ declare const MODULE_REGISTRY: {
6824
6987
  readonly launchermeta_manifest_v0: typeof LauncherMetaManifestV0Module;
6825
6988
  readonly kyros_content_v1: typeof KyrosContentV1Module;
6826
6989
  readonly kyros_files_v0: typeof KyrosFilesV0Module;
6990
+ readonly kyros_files_v1: typeof KyrosFilesV1Module;
6827
6991
  readonly kyros_logs_v1: typeof KyrosLogsV1Module;
6828
6992
  readonly kyros_upload_sessions_v1: typeof KyrosUploadSessionsV1Module;
6829
6993
  readonly labrinth_affiliate_internal: typeof LabrinthAffiliateInternalModule;