@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,98 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthAuthV2Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Log in with a password
7
- *
8
- * Returns a session token on success, or a flow ID if 2FA is required.
9
- *
10
- * @param data - Login credentials and captcha challenge
11
- * @returns Promise resolving to a login response with session or flow
12
- */
13
- login(data: Labrinth.Auth.v2.LoginRequest): Promise<Labrinth.Auth.v2.LoginResponse>;
14
- /**
15
- * Complete a 2FA login flow
16
- *
17
- * @param data - The 2FA code and flow ID
18
- * @returns Promise resolving to a session response
19
- */
20
- login2FA(data: Labrinth.Auth.v2.Login2FARequest): Promise<Labrinth.Auth.v2.Login2FAResponse>;
21
- /**
22
- * Create a new account with a password
23
- *
24
- * @param data - Account creation data
25
- * @returns Promise resolving to a session response
26
- */
27
- createAccount(data: Labrinth.Auth.v2.CreateAccountRequest): Promise<Labrinth.Auth.v2.CreateAccountResponse>;
28
- /**
29
- * Validate email/password inputs for account creation without creating an account.
30
- *
31
- * @param data - Prospective account credentials
32
- */
33
- validateCreateAccount(data: Labrinth.Auth.v2.ValidateCreateAccountRequest): Promise<void>;
34
- /**
35
- * Create a new account from an OAuth callback flow state
36
- *
37
- * @param data - OAuth account creation data
38
- * @returns Promise resolving to a session response
39
- */
40
- createOAuthAccount(data: Labrinth.Auth.v2.CreateOAuthAccountRequest): Promise<Labrinth.Auth.v2.CreateOAuthAccountResponse>;
41
- /**
42
- * Begin a password reset flow by sending a recovery email
43
- *
44
- * @param data - The username/email and captcha challenge
45
- */
46
- resetPasswordBegin(data: Labrinth.Auth.v2.ResetPasswordRequest): Promise<void>;
47
- /**
48
- * Change a user's password (via reset flow or with old password)
49
- *
50
- * @param data - The password change data
51
- */
52
- changePassword(data: Labrinth.Auth.v2.ChangePasswordRequest): Promise<void>;
53
- /**
54
- * List the current user's registered passkeys
55
- *
56
- * @returns A promise that resolves to a list of the user's registered passkeys
57
- */
58
- listPasskeys(): Promise<Labrinth.Auth.v2.Passkey[]>;
59
- /**
60
- * Begin registering a new passkey, returning the WebAuthn creation options and a flow
61
- *
62
- * @returns A promise that resolves to the WebAuthn creation options and flow
63
- */
64
- registerPasskeyStart(): Promise<Labrinth.Auth.v2.PasskeyRegisterStartResponse>;
65
- /**
66
- * Complete passkey registration with the created credential
67
- *
68
- * @param data The credential data and flow to complete registration with
69
- * @returns A promise that resolves to the newly registered passkey
70
- */
71
- registerPasskeyFinish(data: Labrinth.Auth.v2.PasskeyRegisterFinishRequest): Promise<Labrinth.Auth.v2.Passkey>;
72
- /**
73
- * Begin a passkey authentication flow, returning the WebAuthn request options and a flow
74
- *
75
- * @returns A promise that resolves to the WebAuthn request options and a flow
76
- */
77
- authenticatePasskeyStart(): Promise<Labrinth.Auth.v2.PasskeyAuthenticateStartResponse>;
78
- /**
79
- * Complete a passkey authentication flow, returning the new session
80
- *
81
- * @param data The credential data and flow to complete authentication with
82
- * @returns A promise that resolves to the new session
83
- */
84
- authenticatePasskeyFinish(data: Labrinth.Auth.v2.PasskeyAuthenticateFinishRequest): Promise<Labrinth.Sessions.v2.Session>;
85
- /**
86
- * Rename a passkey
87
- *
88
- * @param id The ID of the passkey to rename
89
- * @param data The new name for the passkey
90
- */
91
- renamePasskey(id: string, data: Labrinth.Auth.v2.PasskeyRenameRequest): Promise<void>;
92
- /**
93
- * Delete a passkey
94
- *
95
- * @param id The ID of the passkey to delete
96
- */
97
- deletePasskey(id: string): Promise<void>;
98
- }
@@ -1,65 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthBillingInternalModule extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get user's subscriptions
7
- * GET /_internal/billing/subscriptions
8
- */
9
- getSubscriptions(userId?: string): Promise<Labrinth.Billing.Internal.UserSubscription[]>;
10
- /**
11
- * Get available products for purchase
12
- * GET /_internal/billing/products
13
- */
14
- getProducts(): Promise<Labrinth.Billing.Internal.Product[]>;
15
- /**
16
- * Get Stripe customer information
17
- * GET /_internal/billing/customer
18
- */
19
- getCustomer(): Promise<unknown>;
20
- /**
21
- * Edit a subscription (change product, interval, cancel, etc.)
22
- * PATCH /_internal/billing/subscription/{id}
23
- */
24
- editSubscription(id: string, edit: Labrinth.Billing.Internal.EditSubscriptionRequest, dry?: boolean): Promise<Labrinth.Billing.Internal.EditSubscriptionResponse | void>;
25
- /**
26
- * Get user's payment methods
27
- * GET /_internal/billing/payment_methods
28
- */
29
- getPaymentMethods(): Promise<unknown[]>;
30
- /**
31
- * Initiate flow to add a new payment method
32
- * POST /_internal/billing/payment_method
33
- */
34
- addPaymentMethodFlow(): Promise<Labrinth.Billing.Internal.AddPaymentMethodFlowResponse>;
35
- /**
36
- * Edit a payment method (set as primary)
37
- * PATCH /_internal/billing/payment_method/{id}
38
- */
39
- editPaymentMethod(id: string, body: Labrinth.Billing.Internal.EditPaymentMethodRequest): Promise<void>;
40
- /**
41
- * Remove a payment method
42
- * DELETE /_internal/billing/payment_method/{id}
43
- */
44
- removePaymentMethod(id: string): Promise<void>;
45
- /**
46
- * Get payment history (charges)
47
- * GET /_internal/billing/payments
48
- */
49
- getPayments(userId?: string): Promise<Labrinth.Billing.Internal.Charge[]>;
50
- /**
51
- * Initiate a payment
52
- * POST /_internal/billing/payment
53
- */
54
- initiatePayment(request: Labrinth.Billing.Internal.InitiatePaymentRequest): Promise<Labrinth.Billing.Internal.InitiatePaymentResponse>;
55
- /**
56
- * Refund a charge (Admin only)
57
- * POST /_internal/billing/charge/{id}/refund
58
- */
59
- refundCharge(id: string, refund: Labrinth.Billing.Internal.RefundChargeRequest): Promise<void>;
60
- /**
61
- * Credit subscriptions (Admin only)
62
- * POST /_internal/billing/credit
63
- */
64
- credit(request: Labrinth.Billing.Internal.CreditRequest): Promise<void>;
65
- }
@@ -1,10 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthCampaignInternalModule extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get Pride 2026 campaign fundraising progress.
7
- * GET /_internal/campaign/pride-26
8
- */
9
- getPride26(): Promise<Labrinth.Campaign.Internal.CampaignInfo>;
10
- }
@@ -1,80 +0,0 @@
1
- import { AbstractModule } from '../../core/abstract-module.js';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthCollectionsModule extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get a collection by ID (v3)
7
- *
8
- * @param id - Collection ID
9
- * @returns Promise resolving to the collection data
10
- *
11
- * @example
12
- * ```typescript
13
- * const collection = await client.labrinth.collections.get('AANobbMI')
14
- * ```
15
- */
16
- get(id: string): Promise<Labrinth.Collections.Collection>;
17
- /**
18
- * Get multiple collections by IDs (v3)
19
- *
20
- * @param ids - Array of collection IDs
21
- * @returns Promise resolving to array of collections
22
- *
23
- * @example
24
- * ```typescript
25
- * const collections = await client.labrinth.collections.getMultiple(['AANobbMI', 'BBNoobMI'])
26
- * ```
27
- */
28
- getMultiple(ids: string[]): Promise<Labrinth.Collections.Collection[]>;
29
- /**
30
- * Edit a collection (v3)
31
- *
32
- * @param id - Collection ID
33
- * @param data - Collection update data
34
- *
35
- * @example
36
- * ```typescript
37
- * await client.labrinth.collections.edit('AANobbMI', {
38
- * name: 'Updated name',
39
- * description: 'Updated description',
40
- * status: 'listed'
41
- * })
42
- * ```
43
- */
44
- edit(id: string, data: Labrinth.Collections.EditCollectionRequest): Promise<void>;
45
- /**
46
- * Delete a collection (v3)
47
- *
48
- * @param id - Collection ID
49
- *
50
- * @example
51
- * ```typescript
52
- * await client.labrinth.collections.delete('AANobbMI')
53
- * ```
54
- */
55
- delete(id: string): Promise<void>;
56
- /**
57
- * Edit a collection icon (v3)
58
- *
59
- * @param id - Collection ID
60
- * @param icon - Icon file
61
- * @param ext - File extension (e.g., 'png', 'jpg')
62
- *
63
- * @example
64
- * ```typescript
65
- * await client.labrinth.collections.editIcon('AANobbMI', iconFile, 'png')
66
- * ```
67
- */
68
- editIcon(id: string, icon: Blob, ext: string): Promise<void>;
69
- /**
70
- * Delete a collection icon (v3)
71
- *
72
- * @param id - Collection ID
73
- *
74
- * @example
75
- * ```typescript
76
- * await client.labrinth.collections.deleteIcon('AANobbMI')
77
- * ```
78
- */
79
- deleteIcon(id: string): Promise<void>;
80
- }
@@ -1,6 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthContentV3Module extends AbstractModule {
4
- getModuleID(): string;
5
- resolve(request: Labrinth.Content.v3.ResolveContentRequest): Promise<Labrinth.Content.v3.ResolveContentPlan>;
6
- }
@@ -1,9 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthExternalProjectsInternalModule extends AbstractModule {
4
- getModuleID(): string;
5
- search(data: Labrinth.ExternalProjects.Internal.SearchRequest): Promise<Labrinth.ExternalProjects.Internal.ExternalProject[]>;
6
- getBySha1(sha1: string): Promise<Labrinth.ExternalProjects.Internal.ExternalProject>;
7
- update(id: number, data: Labrinth.ExternalProjects.Internal.UpdateLicenseRequest): Promise<Labrinth.ExternalProjects.Internal.ExternalProject>;
8
- addFile(data: Labrinth.ExternalProjects.Internal.AddFileRequest): Promise<Labrinth.ExternalProjects.Internal.ExternalProject>;
9
- }
@@ -1,23 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthGlobalsInternalModule extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get configured global non-secret variables for this backend instance
7
- *
8
- * @returns Promise resolving to the global configuration
9
- */
10
- get(): Promise<Labrinth.Globals.Internal.Globals>;
11
- }
@@ -1,7 +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 LabrinthImagesV3Module extends AbstractModule {
5
- getModuleID(): string;
6
- uploadImage(file: File | Blob, ext: Labrinth.Images.v3.ImageExtension, target: Labrinth.Images.v3.UploadImageParams): UploadHandle<Labrinth.Images.v3.UploadedImage>;
7
- }
@@ -1,31 +0,0 @@
1
- export * from './analytics/v3';
2
- export * from './attribution/internal';
3
- export * from './auth/internal';
4
- export * from './auth/v2';
5
- export * from './billing/internal';
6
- export * from './collections';
7
- export * from './content/v3';
8
- export * from './external-projects/internal';
9
- export * from './friends/v3';
10
- export * from './globals/internal';
11
- export * from './images/v3';
12
- export * from './limits/v3';
13
- export * from './moderation/internal';
14
- export * from './notifications/v2';
15
- export * from './oauth/internal';
16
- export * from './organizations/v3';
17
- export * from './pats/v2';
18
- export * from './payout/v3';
19
- export * from './payouts/v3';
20
- export * from './projects/v2';
21
- export * from './projects/v3';
22
- export * from './reports/v3';
23
- export * from './server-ping/internal';
24
- export * from './sessions/v2';
25
- export * from './state';
26
- export * from './tech-review/internal';
27
- export * from './threads/v3';
28
- export * from './users/v2';
29
- export * from './users/v3';
30
- export * from './versions/v2';
31
- export * from './versions/v3';
@@ -1,17 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module.js';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthLimitsV3Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get project creation limits for the authenticated user.
7
- */
8
- getProjectLimits(): Promise<Labrinth.Limits.v3.UserLimits>;
9
- /**
10
- * Get organization creation limits for the authenticated user.
11
- */
12
- getOrganizationLimits(): Promise<Labrinth.Limits.v3.UserLimits>;
13
- /**
14
- * Get collection creation limits for the authenticated user.
15
- */
16
- getCollectionLimits(): Promise<Labrinth.Limits.v3.UserLimits>;
17
- }
@@ -1,12 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthModerationInternalModule extends AbstractModule {
4
- getModuleID(): string;
5
- getProjects(params?: Labrinth.Moderation.Internal.ProjectsRequest): Promise<Labrinth.Moderation.Internal.ProjectsResponse>;
6
- getProjectIds(params?: Omit<Labrinth.Moderation.Internal.ProjectsRequest, 'count' | 'offset'>): Promise<Labrinth.Moderation.Internal.ProjectIdsResponse>;
7
- acquireLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
8
- overrideLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockAcquireResponse>;
9
- releaseLock(projectId: string): Promise<Labrinth.Moderation.Internal.ReleaseLockResponse>;
10
- checkLock(projectId: string): Promise<Labrinth.Moderation.Internal.LockStatusResponse>;
11
- setProjectJudgements(judgements: Labrinth.Moderation.Internal.ProjectJudgements): Promise<void>;
12
- }
@@ -1,73 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthNotificationsV2Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get all notifications for a user
7
- *
8
- * @param userId - The user's ID
9
- * @returns Promise resolving to the user's notifications
10
- *
11
- * @example
12
- * ```typescript
13
- * const notifications = await client.labrinth.notifications_v2.getUserNotifications('user123')
14
- * ```
15
- */
16
- getUserNotifications(userId: string): Promise<Labrinth.Notifications.v2.Notification[]>;
17
- /**
18
- * Get multiple notifications by their IDs
19
- *
20
- * @param ids - Array of notification IDs
21
- * @returns Promise resolving to an array of notifications
22
- *
23
- * @example
24
- * ```typescript
25
- * const notifications = await client.labrinth.notifications_v2.getMultiple(['id1', 'id2'])
26
- * ```
27
- */
28
- getMultiple(ids: string[]): Promise<Labrinth.Notifications.v2.Notification[]>;
29
- /**
30
- * Mark a single notification as read
31
- *
32
- * @param id - Notification ID
33
- *
34
- * @example
35
- * ```typescript
36
- * await client.labrinth.notifications_v2.markAsRead('notif123')
37
- * ```
38
- */
39
- markAsRead(id: string): Promise<void>;
40
- /**
41
- * Mark multiple notifications as read
42
- *
43
- * @param ids - Array of notification IDs to mark as read
44
- *
45
- * @example
46
- * ```typescript
47
- * await client.labrinth.notifications_v2.markMultipleAsRead(['id1', 'id2'])
48
- * ```
49
- */
50
- markMultipleAsRead(ids: string[]): Promise<void>;
51
- /**
52
- * Delete a single notification
53
- *
54
- * @param id - Notification ID
55
- *
56
- * @example
57
- * ```typescript
58
- * await client.labrinth.notifications_v2.delete('notif123')
59
- * ```
60
- */
61
- delete(id: string): Promise<void>;
62
- /**
63
- * Delete multiple notifications
64
- *
65
- * @param ids - Array of notification IDs to delete
66
- *
67
- * @example
68
- * ```typescript
69
- * await client.labrinth.notifications_v2.deleteMultiple(['id1', 'id2'])
70
- * ```
71
- */
72
- deleteMultiple(ids: string[]): Promise<void>;
73
- }
@@ -1,97 +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 LabrinthOAuthInternalModule extends AbstractModule {
5
- getModuleID(): string;
6
- /**
7
- * Get a user's OAuth applications
8
- *
9
- * @param userId - The user's ID
10
- * @returns Promise resolving to an array of the user's OAuth clients
11
- */
12
- getUserApps(userId: string): Promise<Labrinth.OAuth.Internal.OAuthClient[]>;
13
- /**
14
- * Get a single OAuth application by ID
15
- *
16
- * @param id - The OAuth client ID
17
- * @returns Promise resolving to the OAuth client
18
- */
19
- getApp(id: string): Promise<Labrinth.OAuth.Internal.OAuthClient>;
20
- /**
21
- * Get multiple OAuth applications by their IDs
22
- *
23
- * @param ids - Array of OAuth client IDs
24
- * @returns Promise resolving to an array of OAuth clients
25
- */
26
- getApps(ids: string[]): Promise<Labrinth.OAuth.Internal.OAuthClient[]>;
27
- /**
28
- * Create a new OAuth application
29
- *
30
- * @param data - The OAuth app creation data
31
- * @returns Promise resolving to the created OAuth client with its client secret
32
- */
33
- createApp(data: Labrinth.OAuth.Internal.CreateOAuthAppRequest): Promise<Labrinth.OAuth.Internal.OAuthClientCreationResult>;
34
- /**
35
- * Edit an existing OAuth application
36
- *
37
- * @param id - The OAuth client ID
38
- * @param data - The fields to update
39
- */
40
- editApp(id: string, data: Labrinth.OAuth.Internal.EditOAuthAppRequest): Promise<void>;
41
- /**
42
- * Delete an OAuth application
43
- *
44
- * @param id - The OAuth client ID
45
- */
46
- deleteApp(id: string): Promise<void>;
47
- /**
48
- * Update the icon for an OAuth application
49
- *
50
- * @param id - The OAuth client ID
51
- * @param file - The icon file
52
- * @param ext - The file extension (e.g. 'png', 'jpeg')
53
- * @returns UploadHandle for progress tracking and cancellation
54
- */
55
- uploadAppIcon(id: string, file: File | Blob, ext: string): UploadHandle<void>;
56
- /**
57
- * Get the current user's OAuth authorizations
58
- *
59
- * @returns Promise resolving to an array of OAuth client authorizations
60
- */
61
- getAuthorizations(): Promise<Labrinth.OAuth.Internal.OAuthClientAuthorization[]>;
62
- /**
63
- * Revoke an OAuth authorization for a client
64
- *
65
- * @param clientId - The OAuth client ID to revoke
66
- */
67
- revokeAuthorization(clientId: string): Promise<void>;
68
- /**
69
- * Initialize an OAuth authorization flow
70
- *
71
- * Returns either an OAuthClientAccessRequest (if user needs to approve)
72
- * or a redirect URL string (if already authorized).
73
- *
74
- * @param params - The OAuth query parameters
75
- * @returns Promise resolving to an access request object or redirect URL string
76
- */
77
- authorize(params: {
78
- client_id: string;
79
- redirect_uri: string;
80
- scope: string;
81
- state?: string;
82
- }): Promise<Labrinth.OAuth.Internal.OAuthClientAccessRequest | string>;
83
- /**
84
- * Accept an OAuth authorization request
85
- *
86
- * @param data - The flow ID to accept
87
- * @returns Promise resolving to a redirect URL string
88
- */
89
- accept(data: Labrinth.OAuth.Internal.AcceptRejectRequest): Promise<string>;
90
- /**
91
- * Reject an OAuth authorization request
92
- *
93
- * @param data - The flow ID to reject
94
- * @returns Promise resolving to a redirect URL string
95
- */
96
- reject(data: Labrinth.OAuth.Internal.AcceptRejectRequest): Promise<string>;
97
- }
@@ -1,66 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthOrganizationsV3Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get an organization by ID or slug
7
- *
8
- * @param idOrSlug - Organization ID or slug
9
- * @returns Promise resolving to the organization data
10
- *
11
- * @example
12
- * ```typescript
13
- * const org = await client.labrinth.organizations_v3.get('my-org')
14
- * ```
15
- */
16
- get(idOrSlug: string): Promise<Labrinth.Organizations.v3.Organization>;
17
- /**
18
- * Get an organization's projects
19
- *
20
- * @param idOrSlug - Organization ID or slug
21
- * @returns Promise resolving to the organization's projects
22
- *
23
- * @example
24
- * ```typescript
25
- * const projects = await client.labrinth.organizations_v3.getProjects('my-org')
26
- * ```
27
- */
28
- getProjects(idOrSlug: string): Promise<Labrinth.Projects.v3.Project[]>;
29
- /**
30
- * Get multiple organizations by their IDs
31
- *
32
- * @param ids - Array of organization IDs
33
- * @returns Promise resolving to an array of organizations
34
- *
35
- * @example
36
- * ```typescript
37
- * const orgs = await client.labrinth.organizations_v3.getMultiple(['id1', 'id2'])
38
- * ```
39
- */
40
- getMultiple(ids: string[]): Promise<Labrinth.Organizations.v3.Organization[]>;
41
- /**
42
- * Add a project to an organization
43
- *
44
- * @param idOrSlug - Organization ID or slug
45
- * @param request - The project to add
46
- *
47
- * @example
48
- * ```typescript
49
- * await client.labrinth.organizations_v3.addProject('my-org', { project_id: 'AABBCCDD' })
50
- * ```
51
- */
52
- addProject(idOrSlug: string, request: Labrinth.Organizations.v3.AddProjectRequest): Promise<void>;
53
- /**
54
- * Remove a project from an organization
55
- *
56
- * @param idOrSlug - Organization ID or slug
57
- * @param projectId - Project ID to remove
58
- * @param data - Request body containing the new_owner user ID
59
- *
60
- * @example
61
- * ```typescript
62
- * await client.labrinth.organizations_v3.removeProject('my-org', 'proj123', { new_owner: 'user456' })
63
- * ```
64
- */
65
- removeProject(idOrSlug: string, projectId: string, data: Labrinth.Organizations.v3.RemoveProjectRequest): Promise<void>;
66
- }
@@ -1,31 +0,0 @@
1
- import { AbstractModule } from '../../../core/abstract-module';
2
- import type { Labrinth } from '../types';
3
- export declare class LabrinthPatsV2Module extends AbstractModule {
4
- getModuleID(): string;
5
- /**
6
- * Get all personal access tokens for the authenticated user
7
- *
8
- * @returns Promise resolving to an array of PATs
9
- */
10
- list(): Promise<Labrinth.Pats.v2.PersonalAccessToken[]>;
11
- /**
12
- * Create a new personal access token
13
- *
14
- * @param data - The PAT creation request data
15
- * @returns Promise resolving to the newly created PAT (includes access_token)
16
- */
17
- create(data: Labrinth.Pats.v2.CreatePatRequest): Promise<Labrinth.Pats.v2.PersonalAccessToken>;
18
- /**
19
- * Modify an existing personal access token
20
- *
21
- * @param id - The PAT ID
22
- * @param data - The fields to update
23
- */
24
- modify(id: string, data: Labrinth.Pats.v2.ModifyPatRequest): Promise<void>;
25
- /**
26
- * Delete a personal access token
27
- *
28
- * @param id - The PAT ID
29
- */
30
- delete(id: string): Promise<void>;
31
- }