@badrap/libapp
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -27,7 +27,7 @@ import * as v from "@badrap/valita"; | ||
}>; | ||
export declare class API<InstallationState extends Record<string, unknown>> { | ||
export declare class API<InstallationState extends Record<string, unknown> = Record<string, unknown>> { | ||
private readonly apiToken; | ||
private readonly baseUrl; | ||
private readonly stateType; | ||
constructor(apiUrl: string, apiToken: string, stateType: v.Type<InstallationState>); | ||
constructor(apiUrl: string, apiToken: string, stateType?: v.Type<InstallationState>); | ||
private installationUrl; | ||
@@ -34,0 +34,0 @@ private request; |
@@ -54,3 +54,3 @@ "use strict"; | ||
constructor(apiUrl, apiToken, stateType) { | ||
this.stateType = stateType; | ||
this.stateType = stateType !== null && stateType !== void 0 ? stateType : v.record(); | ||
this.apiToken = apiToken; | ||
@@ -57,0 +57,0 @@ this.baseUrl = new URL(apiUrl); |
{ | ||
"name": "@badrap/libapp", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "TypeScript helpers for creating Badrap apps", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -44,3 +44,5 @@ import path from "node:path"; | ||
export class API<InstallationState extends Record<string, unknown>> { | ||
export class API< | ||
InstallationState extends Record<string, unknown> = Record<string, unknown> | ||
> { | ||
private readonly apiToken: string; | ||
@@ -53,5 +55,5 @@ private readonly baseUrl: URL; | ||
apiToken: string, | ||
stateType: v.Type<InstallationState> | ||
stateType?: v.Type<InstallationState> | ||
) { | ||
this.stateType = stateType; | ||
this.stateType = stateType ?? (v.record() as v.Type<InstallationState>); | ||
this.apiToken = apiToken; | ||
@@ -58,0 +60,0 @@ this.baseUrl = new URL(apiUrl); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43992
966
0