@modrinth/api-client 0.11.0 → 0.13.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.
@@ -3,7 +3,7 @@ export type { AuthConfig } from '../features/auth';
3
3
  export type { CircuitBreakerConfig, CircuitBreakerState, CircuitBreakerStorage, } from '../features/circuit-breaker';
4
4
  export type { BackoffStrategy, RetryConfig } from '../features/retry';
5
5
  export type { Archon } from '../modules/archon/types';
6
- export type { ClientConfig, RequestHooks } from './client';
6
+ export type { BaseUrlConfig, ClientConfig, RequestHooks } from './client';
7
7
  export type { ApiErrorData, ModrinthErrorResponse } from './errors';
8
8
  export { isModrinthErrorResponse } from './errors';
9
9
  export type { HttpMethod, RequestContext, RequestOptions, ResponseData } from './request';
@@ -0,0 +1,4 @@
1
+ import type { RequestOptions } from '../types/request';
2
+ export declare function appendRequestParams(url: string, params?: RequestOptions['params']): string;
3
+ export declare function toFetchBody(body: unknown): BodyInit | null | undefined;
4
+ export declare function parseResponseErrorData(response: Response): Promise<unknown>;
@@ -0,0 +1,24 @@
1
+ import type { Archon } from '../modules/archon/types';
2
+ export type ParsedSseEvent = {
3
+ kind: 'event';
4
+ id?: string;
5
+ event?: string;
6
+ data: string;
7
+ };
8
+ export type ParsedSseRetry = {
9
+ kind: 'retry';
10
+ retry: number;
11
+ };
12
+ export type ParsedSseItem = ParsedSseEvent | ParsedSseRetry;
13
+ export declare class SseParser {
14
+ private buffer;
15
+ private eventName;
16
+ private data;
17
+ private id;
18
+ feed(chunk: string): ParsedSseItem[];
19
+ end(): ParsedSseItem[];
20
+ private findLineEnd;
21
+ private processLine;
22
+ private dispatch;
23
+ }
24
+ export declare function parseSyncEventData(data: string): Archon.Sync.v1.SyncEvent | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modrinth/api-client",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "An API client for Modrinth's API for use in nuxt, tauri and plain node/browser environments.",
5
5
  "license": "LGPL-3.0-only",
6
6
  "type": "module",