@balena/abstract-sql-to-typescript 3.0.1 → 3.0.2

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.
@@ -1,3 +1,15 @@
1
+ - commits:
2
+ - subject: Improve `Resource` typing
3
+ hash: ba1301734f1a71dc2a920d1f378173a6bfa7c4a5
4
+ body: ""
5
+ footer:
6
+ Change-type: patch
7
+ change-type: patch
8
+ author: Pagan Gazzard
9
+ nested: []
10
+ version: 3.0.2
11
+ title: ""
12
+ date: 2024-05-09T18:58:21.825Z
1
13
  - commits:
2
14
  - subject: Use `[A] | []` rather than `[A?]` for singular references
3
15
  hash: 0b9661d460138a2e93e30974bb792f2f452290b0
@@ -27,7 +39,7 @@
27
39
  nested: []
28
40
  version: 3.0.1
29
41
  title: ""
30
- date: 2024-05-03T16:59:02.876Z
42
+ date: 2024-05-04T04:34:02.941Z
31
43
  - commits:
32
44
  - subject: Export a `Resource` type which all resources should conform to
33
45
  hash: 188ac11c28a722c202732b0ee71760e6e0c0d4e4
package/CHANGELOG.md CHANGED
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file
4
4
  automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
5
5
  This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
- ## 3.0.1 - 2024-05-03
7
+ ## 3.0.2 - 2024-05-09
8
+
9
+ * Improve `Resource` typing [Pagan Gazzard]
10
+
11
+ ## 3.0.1 - 2024-05-04
8
12
 
9
13
  * Use `[A] | []` rather than `[A?]` for singular references [Pagan Gazzard]
10
14
  * Fix `Resource` typing to allow for null [Pagan Gazzard]
package/out/index.d.ts CHANGED
@@ -10,7 +10,9 @@ export type PickDeferred<T, K extends keyof T = keyof T> = {
10
10
  };
11
11
  type ReadTypes = Types[keyof Types]['Read'];
12
12
  type WriteTypes = Types[keyof Types]['Write'];
13
- export type Resource<T extends object = object> = {
13
+ export type Resource<T extends object = {
14
+ [index: string]: any;
15
+ }> = {
14
16
  Read: {
15
17
  [key in keyof T]: ReadTypes | {
16
18
  __id: ReadTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/abstract-sql-to-typescript",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "A translator for abstract sql into typescript types.",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -50,6 +50,6 @@
50
50
  "_": "test/**/*.ts"
51
51
  },
52
52
  "versionist": {
53
- "publishedAt": "2024-05-03T16:59:03.119Z"
53
+ "publishedAt": "2024-05-09T18:58:22.046Z"
54
54
  }
55
55
  }
package/src/index.ts CHANGED
@@ -13,7 +13,11 @@ export type PickDeferred<T, K extends keyof T = keyof T> = {
13
13
  type ReadTypes = Types[keyof Types]['Read'];
14
14
  type WriteTypes = Types[keyof Types]['Write'];
15
15
 
16
- export type Resource<T extends object = object> = {
16
+ export type Resource<
17
+ T extends object = {
18
+ [index: string]: any;
19
+ },
20
+ > = {
17
21
  Read: {
18
22
  [key in keyof T]:
19
23
  | ReadTypes