@brickset-api/types 0.0.11 → 0.0.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @brickset-api/types
2
2
 
3
+ ## 0.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 12f1397: Update types
8
+
3
9
  ## 0.0.11
4
10
 
5
11
  ### Patch Changes
package/endpoints.ts CHANGED
@@ -10,16 +10,6 @@ export type KnownUnauthorizedEndpoint =
10
10
 
11
11
  export type KnownEndpoint = KnownAuthenticatedEndpoint | KnownUnauthorizedEndpoint;
12
12
 
13
- // helper types for parameters
14
- type CombineParameters<P1 extends string, P2 extends string> = `${P1}&${P2}` | `${P2}&${P1}`;
15
-
16
- type WithParameters<Url extends string, Parameters extends string | undefined> =
17
- Parameters extends undefined ? Url : `${Url}?${Parameters}`;
18
-
19
- // helper for endpoints with parameters
20
- type ParamsParameter = `params=${string}`;
21
- type EndpointWithParams<Endpoint extends KnownEndpoint> = WithParameters<Endpoint, ParamsParameter>;
22
-
23
13
  // options
24
14
  type Options = {};
25
15
 
@@ -37,14 +27,9 @@ export type OptionsByEndpoint<Endpoint extends string> =
37
27
  Endpoint extends '/api/v3.asmx/getYears' ? Options & { theme?: string } & ApiKeyOptions :
38
28
  Partial<AuthenticatedOptions & ApiKeyOptions>;
39
29
 
40
- type ApiResponse<T> = {
41
- status: string;
42
- message?: string;
43
- } & T;
44
-
45
30
  // result type for endpoint
46
31
  export type EndpointType<Url extends KnownEndpoint | (string & {})> =
47
- Url extends '/api/v3.asmx/getSets' ? { status: 'success' | 'error'; message?: string; sets: GetSets } :
32
+ Url extends '/api/v3.asmx/getSets' ? { status: 'error'; message: string } | { status: 'success'; matches: number; sets: GetSets[] } :
48
33
  unknown;
49
34
 
50
35
  export type ValidateEndpointUrl<T extends string> = unknown extends EndpointType<T> ? 'unknown endpoint url' : T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickset-api/types",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "TypeScript types for all datastructures used by the Brickset API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "build": "tsc"
29
29
  },
30
30
  "devDependencies": {
31
- "typescript": "5.5.4"
31
+ "typescript": "5.6.2"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"