@beepbox.net/gofetch-client 0.2.5 → 0.2.6

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
@@ -12,8 +12,30 @@ export type ReqOpts = { headers?: Record<string, string> }
12
12
 
13
13
  export type GofetchFetcher = { raw: GofetchClient; beep: { list: (query?: QueryOf<((options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: { [x: string]: unknown; } | undefined; query?: { songType?: (SongType) | undefined; state?: (BeepState) | undefined; userId?: string | undefined; platformId?: string | undefined; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; isGuided?: boolean | "false" | "true" | undefined; expand?: (BeepExpandOption) | (BeepExpandOption)[] | undefined; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, query?: QueryOf<BeepItem["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; description: string; isGuided: boolean; songType: (SongType); state: (BeepState); albumArt?: string | undefined; url?: string | undefined; shortUrl?: string | undefined; authors?: string[] | undefined; platforms?: string[] | undefined; links?: string[] | undefined; forks?: string[] | undefined; forkedFrom?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; forks: (id: string, query?: QueryOf<BeepItem["forks"]["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: (string | { id: string; title: string; description: string; isGuided: boolean; songType: (SongType); state: (BeepState); albumArt?: string | undefined; url?: string | undefined; shortUrl?: string | undefined; authors?: string[] | undefined; platforms?: string[] | undefined; links?: string[] | undefined; forks?: string[] | undefined; forkedFrom?: string[] | undefined; })[]; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; original: (id: string, query?: QueryOf<BeepItem["original"]["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: string | { id: string; title: string; description: string; isGuided: boolean; songType: (SongType); state: (BeepState); albumArt?: string | undefined; url?: string | undefined; shortUrl?: string | undefined; authors?: string[] | undefined; platforms?: string[] | undefined; links?: string[] | undefined; forks?: string[] | undefined; forkedFrom?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; authors: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; create: (body: BodyOf<((body: { title: string; description: string; url: string; isGuided: boolean | "false" | "true"; songType: (SongType); state: (BeepState); shortUrl?: string | undefined; albumArt?: string | undefined; basedOn?: string | undefined; madeIn?: string | undefined; sources?: string[] | undefined; }, options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: { [x: string]: unknown; } | undefined; query?: { [x: string]: unknown; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; description: string; url: string; isGuided: boolean; songType: (SongType); state: (BeepState); shortUrl?: string | undefined; albumArt?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; description: string; url: string; isGuided: boolean; songType: (SongType); state: (BeepState); shortUrl?: string | undefined; albumArt?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<BeepItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; description: string; url: string; isGuided: boolean; songType: (SongType); state: (BeepState); shortUrl?: string | undefined; albumArt?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; event: { list: (query?: QueryOf<((options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: { state?: (EventState) | (EventState)[] | undefined; hostId?: string | undefined; startAfter?: string | Date | undefined; startBefore?: string | Date | undefined; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; expand?: (EventExpandOption) | (EventExpandOption)[] | undefined; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, query?: QueryOf<EventItem["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; state: (EventState); config: { allowSelfRegistration: boolean; allowPostStartRegistration: boolean; visibility: (EventVisibility); maxParticipants?: number | undefined; }; startDate?: Date | (DateTime) | null | undefined; endDate?: Date | (DateTime) | null | undefined; hosts?: string[] | undefined; participants?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; create: (body: BodyOf<((body: { title: string; startDate?: string | Date | { equals: {}; toJSON: {}; toString: {}; toCompact: {}; toISOString: {}; toDate: {}; add: {}; sub: {}; diff: {}; compare: {}; readonly nanoseconds: string | bigint; readonly microseconds: string | bigint; readonly milliseconds: string | number; readonly seconds: string | number; } | null | undefined; endDate?: string | Date | { equals: {}; toJSON: {}; toString: {}; toCompact: {}; toISOString: {}; toDate: {}; add: {}; sub: {}; diff: {}; compare: {}; readonly nanoseconds: string | bigint; readonly microseconds: string | bigint; readonly milliseconds: string | number; readonly seconds: string | number; } | null | undefined; hostedBy: string[]; config?: { allowSelfRegistration: boolean | "false" | "true"; allowPostStartRegistration: boolean | "false" | "true"; visibility: (EventVisibility); maxParticipants?: string | number | undefined; } | undefined; state?: (EventState) | undefined; }, options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: {} | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; state: (EventState); config: { allowSelfRegistration: boolean; allowPostStartRegistration: boolean; visibility: (EventVisibility); maxParticipants?: number | undefined; }; startDate?: Date | (DateTime) | null | undefined; endDate?: Date | (DateTime) | null | undefined; hosts?: string[] | undefined; participants?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; state: (EventState); config: { allowSelfRegistration: boolean; allowPostStartRegistration: boolean; visibility: (EventVisibility); maxParticipants?: number | undefined; }; startDate?: Date | (DateTime) | null | undefined; endDate?: Date | (DateTime) | null | undefined; hosts?: string[] | undefined; participants?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<EventItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; hosts: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; addHosts: (id: string, body: BodyOf<EventItem["hosts"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; removeHost: (id: string, userId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; participants: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; addParticipants: (id: string, body: BodyOf<EventItem["participants"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; removeParticipant: (id: string, userId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: unknown; }>>; join: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; participantId: string; eventId: string; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; leave: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; openRegistration: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; start: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; close: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; archive: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; }; platform: { list: (query?: QueryOf<((options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: { [x: string]: unknown; } | undefined; query?: { limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; expand?: (PlatformExpandOption) | (PlatformExpandOption)[] | undefined; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; beeps: (id: string, query?: QueryOf<PlatformItem["beeps"]["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; tree: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; forks: any[]; logo?: string | undefined; wikiUrl?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; create: (body: BodyOf<((body: { name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; forks?: string[] | undefined; }, options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: {} | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<PlatformItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; source: { list: (query?: QueryOf<((options: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: { [x: string]: unknown; } | undefined; query: { type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; } | { type: SourceType.OTHER; label: string; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; }; }) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; url: string; } | { id: string; type: SourceType.OTHER; label: string; url: string; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; beeps: (id: string, query?: QueryOf<SourceItem["beeps"]["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; create: (body: BodyOf<((body: { type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; url: string; } | { type: SourceType.OTHER; label: string; url: string; }, options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: { [x: string]: unknown; } | undefined; query?: { [x: string]: unknown; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { id: string; type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; url: string; } | { id: string; type: SourceType.OTHER; label: string; url: string; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; url: string; } | { id: string; type: SourceType.OTHER; label: string; url: string; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<SourceItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; type: SourceType.YOUTUBE | SourceType.YT_MUSIC | SourceType.SOUND_CLOUD | SourceType.SPOTIFY | SourceType.APPLE_MUSIC | SourceType.FILE_GARDEN | SourceType.NEWGROUNDS | SourceType.BANDCAMP; url: string; } | { id: string; type: SourceType.OTHER; label: string; url: string; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; forum: { listForEvent: (eventId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; createForEvent: (eventId: string, body: BodyOf<ForumEventItem["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; forumData: ({ key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; })[]; submissionFields: ({ key: string; required: boolean; label?: string | undefined; type: FieldType.TEXT; config?: { minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.INT | FieldType.FLOAT; config?: { min?: number | undefined; max?: number | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.URL; config?: { allowedDomains?: string[] | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.USER | FieldType.BEEP | FieldType.BOOLEAN; config?: Map<unknown, unknown> | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.CHOICE; config?: { options: string[]; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.DATE; config?: { min?: Date | undefined; max?: Date | undefined; } | undefined; })[]; archived: boolean; submissionsOpen: boolean; submissionsPublic: boolean; scoresOpen: boolean; scoresPublic: boolean; scoringConfig?: { fields: ({ key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.NUMBER; config: { min: number; max: number; }; } | { key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.ENUM; options: { label: string; value: number; }[]; })[]; overallNoteConfig: (NoteConfig); aggregationMethod: (AggregationMethod); skippedBehavior: (SkippedBehavior); } | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; forumData: ({ key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; })[]; submissionFields: ({ key: string; required: boolean; label?: string | undefined; type: FieldType.TEXT; config?: { minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.INT | FieldType.FLOAT; config?: { min?: number | undefined; max?: number | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.URL; config?: { allowedDomains?: string[] | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.USER | FieldType.BEEP | FieldType.BOOLEAN; config?: Map<unknown, unknown> | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.CHOICE; config?: { options: string[]; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.DATE; config?: { min?: Date | undefined; max?: Date | undefined; } | undefined; })[]; archived: boolean; submissionsOpen: boolean; submissionsPublic: boolean; scoresOpen: boolean; scoresPublic: boolean; scoringConfig?: { fields: ({ key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.NUMBER; config: { min: number; max: number; }; } | { key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.ENUM; options: { label: string; value: number; }[]; })[]; overallNoteConfig: (NoteConfig); aggregationMethod: (AggregationMethod); skippedBehavior: (SkippedBehavior); } | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<ForumItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; forumData: ({ key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; })[]; submissionFields: ({ key: string; required: boolean; label?: string | undefined; type: FieldType.TEXT; config?: { minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.INT | FieldType.FLOAT; config?: { min?: number | undefined; max?: number | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.URL; config?: { allowedDomains?: string[] | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.USER | FieldType.BEEP | FieldType.BOOLEAN; config?: Map<unknown, unknown> | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.CHOICE; config?: { options: string[]; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.DATE; config?: { min?: Date | undefined; max?: Date | undefined; } | undefined; })[]; archived: boolean; submissionsOpen: boolean; submissionsPublic: boolean; scoresOpen: boolean; scoresPublic: boolean; scoringConfig?: { fields: ({ key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.NUMBER; config: { min: number; max: number; }; } | { key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.ENUM; options: { label: string; value: number; }[]; })[]; overallNoteConfig: (NoteConfig); aggregationMethod: (AggregationMethod); skippedBehavior: (SkippedBehavior); } | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; archive: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; forumData: ({ key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; })[]; submissionFields: ({ key: string; required: boolean; label?: string | undefined; type: FieldType.TEXT; config?: { minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.INT | FieldType.FLOAT; config?: { min?: number | undefined; max?: number | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.URL; config?: { allowedDomains?: string[] | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.USER | FieldType.BEEP | FieldType.BOOLEAN; config?: Map<unknown, unknown> | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.CHOICE; config?: { options: string[]; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.DATE; config?: { min?: Date | undefined; max?: Date | undefined; } | undefined; })[]; archived: boolean; submissionsOpen: boolean; submissionsPublic: boolean; scoresOpen: boolean; scoresPublic: boolean; scoringConfig?: { fields: ({ key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.NUMBER; config: { min: number; max: number; }; } | { key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.ENUM; options: { label: string; value: number; }[]; })[]; overallNoteConfig: (NoteConfig); aggregationMethod: (AggregationMethod); skippedBehavior: (SkippedBehavior); } | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; unarchive: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; title: string; forumData: ({ key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; } | { key: string; type: FieldType.TEXT | FieldType.USER | FieldType.BEEP; value: string; } | { key: string; type: FieldType.INT | FieldType.FLOAT; value: number; } | { key: string; type: FieldType.URL; value: string; } | { key: string; type: FieldType.BOOLEAN; value: boolean; } | { key: string; type: FieldType.DATE; value: Date; })[]; submissionFields: ({ key: string; required: boolean; label?: string | undefined; type: FieldType.TEXT; config?: { minLength?: number | undefined; maxLength?: number | undefined; pattern?: string | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.INT | FieldType.FLOAT; config?: { min?: number | undefined; max?: number | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.URL; config?: { allowedDomains?: string[] | undefined; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.USER | FieldType.BEEP | FieldType.BOOLEAN; config?: Map<unknown, unknown> | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.CHOICE; config?: { options: string[]; } | undefined; } | { key: string; required: boolean; label?: string | undefined; type: FieldType.DATE; config?: { min?: Date | undefined; max?: Date | undefined; } | undefined; })[]; archived: boolean; submissionsOpen: boolean; submissionsPublic: boolean; scoresOpen: boolean; scoresPublic: boolean; scoringConfig?: { fields: ({ key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.NUMBER; config: { min: number; max: number; }; } | { key: string; required: boolean; label?: string | undefined; weight: number; noteConfig: (NoteConfig); inputType: ScoreComponentType.ENUM; options: { label: string; value: number; }[]; })[]; overallNoteConfig: (NoteConfig); aggregationMethod: (AggregationMethod); skippedBehavior: (SkippedBehavior); } | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; submission: { listForForum: (forumId: string, query?: QueryOf<SubForumItem["get"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; createForForum: (forumId: string, body: BodyOf<SubForumItem["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; state: (SubmissionState); fieldValues: { [x: string]: string | number | boolean | Date; }; url?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; state: (SubmissionState); fieldValues: { [x: string]: string | number | boolean | Date; }; url?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<SubItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; state: (SubmissionState); fieldValues: { [x: string]: string | number | boolean | Date; }; url?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; setState: (id: string, body: BodyOf<SubItem["state"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; state: (SubmissionState); fieldValues: { [x: string]: string | number | boolean | Date; }; url?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; myScore: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; judgeId: string; overallNote?: string | undefined; components: { [x: string]: { value: number; note?: string | undefined; }; }; } | null; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; computeScore: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { raw: number; adjusted: number; groups: { id: string; name: string; weight: number; judgeScores: { judge: string; total: number; dropped: boolean; }[]; average?: number | undefined; }[]; adjustments: { id: string; value: number; type: (ScoreAdjustmentType); reason?: string | undefined; }[]; meta: { droppedWorst: number; missingJudges: { name: string; group: string; }[]; }; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; scores: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; submitScore: (id: string, body: BodyOf<SubItem["scores"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: RecordId<string, (string | number | bigint | unknown[] | Record<string, unknown> | Uuid)>; in: RecordId<string, (string | number | bigint | unknown[] | Record<string, unknown> | Uuid)>; out: RecordId<string, (string | number | bigint | unknown[] | Record<string, unknown> | Uuid)>; components: { [x: string]: { value: number; note?: string | undefined; }; }; overallNote?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; deleteMyScore: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; adjustments: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; createAdjustment: (id: string, body: BodyOf<SubItem["adjustments"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; value: number; type: (ScoreAdjustmentType); reason?: string | undefined; createdAt?: Date | (DateTime) | null | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; deleteAdjustment: (adjustmentId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; forBeep: (beepId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; weightGroup: { listForEvent: (eventId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; createForEvent: (eventId: string, body: BodyOf<WgEventItem["weightGroup"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; name: string; weight: number; isDefault: boolean; users?: string[] | undefined; event?: string[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<WgItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: any; }>>; delete: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: unknown; }>>; members: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; addMembers: (id: string, body: BodyOf<WgItem["members"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: unknown; }>>; removeMember: (id: string, userId: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ [x: string]: unknown; }>>; }; xp: { list: (query?: QueryOf<((options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: { source?: string | undefined; sourceType?: "event" | "user" | "submission_forum" | "submission" | undefined; retracted?: boolean | "false" | "true" | undefined; userId?: string | undefined; amountRange?: { min: string | number; max: string | number; } | undefined; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; mine: (opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; grant: (body: BodyOf<((body: { amount: string | number; reason?: string | undefined; key: string; toUser: string; fromUser: string; } | { amount: string | number; reason?: string | undefined; key: string; toUser: string; fromSubmission: string; } | { amount: string | number; reason?: string | undefined; key: string; toUser: string; fromEvent: string; } | { amount: string | number; reason?: string | undefined; key: string; toUser: string; fromForum: string; }, options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: {} | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { id: string; amount: number; source: string; retracted: boolean; reason?: string | undefined; retractedReason?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; amount: number; source: string; retracted: boolean; reason?: string | undefined; retractedReason?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; retract: (id: string, body?: BodyOf<XpItem["retract"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; amount: number; source: string; retracted: boolean; reason?: string | undefined; retractedReason?: string | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; user: { me: (opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; list: (query?: QueryOf<((options?: { fetch?: { body?: string | { readonly locked: boolean | "false" | "true"; cancel: {}; getReader: {}; pipeThrough: {}; pipeTo: {}; tee: {}; values: {}; [Symbol.asyncIterator]: {}; } | { append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; } | { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly buffer: { readonly byteLength: string | number; slice: {}; readonly maxByteLength: string | number; readonly resizable: boolean | "false" | "true"; resize: {}; readonly detached: boolean | "false" | "true"; transfer: {}; transferToFixedLength: {}; readonly [Symbol.toStringTag]: "ArrayBuffer"; }; readonly byteLength: string | number; readonly byteOffset: string | number; } | { readonly size: string | number; readonly type: string; arrayBuffer: {}; bytes: {}; slice: {}; stream: {}; text: {}; json: {}; image: {}; formData: {}; } | { readonly size: string | number; append: {}; delete: {}; get: {}; getAll: {}; has: {}; set: {}; sort: {}; toString: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; } | null | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: string[][] | { [x: string]: string; } | { append: {}; delete: {}; get: {}; getSetCookie: {}; has: {}; set: {}; forEach: {}; entries: {}; keys: {}; values: {}; [Symbol.iterator]: {}; toJSON: {}; readonly count: string | number; getAll: {}; } | undefined; integrity?: string | undefined; keepalive?: boolean | "false" | "true" | undefined; method?: string | undefined; mode?: RequestMode | undefined; priority?: RequestPriority | undefined; redirect?: RequestRedirect | undefined; referrer?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; signal?: { readonly aborted: boolean | "false" | "true"; onabort: {} | null; readonly reason: any; throwIfAborted: {}; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; } | null | undefined; window?: null | undefined; } | undefined; throwHttpError?: boolean | "false" | "true" | {} | undefined; headers?: {} | undefined; query?: { displayName?: string | undefined; role?: (Role) | undefined; limit?: string | number | undefined; sort?: string | undefined; cursor?: string | false | undefined; disabled?: boolean | "false" | "true" | undefined; } | undefined; } | undefined) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>) & { '~path': string; }>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { data: unknown[]; nextCursor: string | null; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; get: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; update: (id: string, body: BodyOf<UserItem["patch"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; setRole: (id: string, body: BodyOf<UserItem["role"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; disable: (id: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; setAccess: (id: string, body: BodyOf<UserItem["portal-access"]["post"]>, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { id: string; avatar: string | null; displayName: string; role: (Role); disabled: boolean; portalAccess: (PortalAccess); }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; util: { resolveShortUrl: (url: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { resolvedUrl: string; modName: string; modId: string; steps?: { url: string; via: "redirect" | "meta-refresh" | "canonical" | "body-link"; status?: number | undefined; }[] | undefined; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; resolvePlatform: (url: string, opts?: ReqOpts) => Promise<any.TreatyResponse<{ 200: { platform: { id: string; name: string; description: string; url: string; alternateVersions: { url: string; name: string; }[]; logo?: string | undefined; wikiUrl?: string | undefined; forkedBy: string[]; forks: string[]; }; matchedOn: string; matchedName: string; confidence: "prefix" | "exact"; }; 422: { type: "validation"; on: string; summary?: string; message?: string; found?: unknown; property?: string; expected?: string; }; }>>; }; }
14
14
 
15
+ export type OAuthCallbackUser = {
16
+ id: string
17
+ displayName: string
18
+ avatar: string | null
19
+ role: string
20
+ disabled: boolean
21
+ portalAccess: string
22
+ }
23
+
24
+ export type OAuthCallbackResult =
25
+ | { ok: true; accessToken: string; user: OAuthCallbackUser }
26
+ | { ok: false; error: string; errorDescription?: string }
27
+
15
28
  export declare const defaultBaseUrl: string
16
29
 
30
+ export declare function buildLoginUrl(options: {
31
+ baseUrl?: string
32
+ returnTo: string
33
+ }): string
34
+
35
+ export declare function parseOAuthCallback(hash?: string): OAuthCallbackResult | null
36
+
37
+ export declare function clearOAuthCallbackHash(): void
38
+
17
39
  export declare function createClient(options?: {
18
40
  baseUrl?: string
19
41
  token?: string
package/dist/index.js CHANGED
@@ -151,6 +151,46 @@ function createFetcher(options = {}) {
151
151
  util: makeUtil(api)
152
152
  };
153
153
  }
154
+ // src/auth.ts
155
+ function currentHash() {
156
+ if (typeof window === "undefined")
157
+ return "";
158
+ return window.location.hash;
159
+ }
160
+ function buildLoginUrl(options) {
161
+ const base = (options.baseUrl ?? defaultBaseUrl).replace(/\/$/, "");
162
+ const url = new URL(`${base}/v0/auth/discord`);
163
+ url.searchParams.set("returnTo", options.returnTo);
164
+ return url.toString();
165
+ }
166
+ function parseOAuthCallback(hash = currentHash()) {
167
+ const raw = hash.startsWith("#") ? hash.slice(1) : hash;
168
+ if (!raw)
169
+ return null;
170
+ const params = new URLSearchParams(raw);
171
+ if (params.has("error")) {
172
+ return {
173
+ ok: false,
174
+ error: params.get("error") ?? "unknown",
175
+ errorDescription: params.get("error_description") ?? undefined
176
+ };
177
+ }
178
+ const accessToken = params.get("accessToken");
179
+ const userRaw = params.get("user");
180
+ if (!accessToken || !userRaw)
181
+ return null;
182
+ try {
183
+ const user = JSON.parse(userRaw);
184
+ return { ok: true, accessToken, user };
185
+ } catch {
186
+ return null;
187
+ }
188
+ }
189
+ function clearOAuthCallbackHash() {
190
+ if (typeof window === "undefined" || !window.location.hash)
191
+ return;
192
+ window.history.replaceState(null, "", window.location.pathname + window.location.search);
193
+ }
154
194
 
155
195
  // src/runtime.ts
156
196
  var defaultBaseUrl = "https://gofetch.blaqat.net";
@@ -161,7 +201,10 @@ function createClient(options = {}) {
161
201
  }
162
202
  export {
163
203
  treaty,
204
+ parseOAuthCallback,
164
205
  defaultBaseUrl,
165
206
  createFetcher,
166
- createClient
207
+ createClient,
208
+ clearOAuthCallbackHash,
209
+ buildLoginUrl
167
210
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beepbox.net/gofetch-client",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Typesafe Eden treaty client for the gofetch API",
5
5
  "license": "UNLICENSED",
6
6
  "files": [