@brickset-api/types 0.0.10 → 0.0.11

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.11
4
+
5
+ ### Patch Changes
6
+
7
+ - f315e4d: Update endpoint types
8
+
3
9
  ## 0.0.10
4
10
 
5
11
  ### Patch Changes
package/data/get-sets.ts CHANGED
@@ -1,6 +1,4 @@
1
- export type GetSets = GetSetsResponse;
2
-
3
- export type Item = ItemBase;
1
+ export type GetSets = GetSetsBase;
4
2
 
5
3
  export type GetSetsOptions = {
6
4
  setID?: number;
@@ -23,14 +21,7 @@ export type GetSetsOptions = {
23
21
  extendedData?: boolean;
24
22
  };
25
23
 
26
- interface GetSetsResponse {
27
- message?: string;
28
- status: string;
29
- matches?: number;
30
- sets?: ItemBase[];
31
- }
32
-
33
- interface ItemBase {
24
+ interface GetSetsBase {
34
25
  setID: number;
35
26
  number: string;
36
27
  numberVariant: string;
package/endpoints.ts CHANGED
@@ -44,7 +44,7 @@ type ApiResponse<T> = {
44
44
 
45
45
  // result type for endpoint
46
46
  export type EndpointType<Url extends KnownEndpoint | (string & {})> =
47
- Url extends '/api/v3.asmx/getSets' ? ApiResponse<{ sets: GetSets }> :
47
+ Url extends '/api/v3.asmx/getSets' ? { status: 'success' | 'error'; message?: string; sets: GetSets } :
48
48
  unknown;
49
49
 
50
50
  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.10",
3
+ "version": "0.0.11",
4
4
  "description": "TypeScript types for all datastructures used by the Brickset API",
5
5
  "license": "MIT",
6
6
  "repository": {