@balena/sbvr-types 7.1.1 → 7.1.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,16 @@
1
+ - commits:
2
+ - subject: Explicitly type the `compare` function for `hashed`
3
+ hash: 6ece56f531ba9507fb090003bd3216e90b2f583b
4
+ body: |
5
+ This avoids the need for downstream users to have the bcrypt types
6
+ available whilst also avoiding accidental breaking changes
7
+ footer:
8
+ Change-type: patch
9
+ change-type: patch
10
+ author: Pagan Gazzard
11
+ version: 7.1.2
12
+ title: ""
13
+ date: 2024-06-12T12:14:00.325Z
1
14
  - commits:
2
15
  - subject: Accept `Date` for the write types of `Date Time`/`Date`/`Time`
3
16
  hash: eb03c8fb593fad76c74dad57a3d45625daf44d76
@@ -8,7 +21,7 @@
8
21
  author: Pagan Gazzard
9
22
  version: 7.1.1
10
23
  title: ""
11
- date: 2024-06-03T18:07:36.309Z
24
+ date: 2024-06-04T09:59:12.864Z
12
25
  - commits:
13
26
  - subject: Export typescript read/write types for each sbvr type
14
27
  hash: 66b9a012e242533372ce34a73e31f6e3aac93d91
package/CHANGELOG.md CHANGED
@@ -4,8 +4,13 @@ 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
+ # v7.1.2
8
+ ## (2024-06-12)
9
+
10
+ * Explicitly type the `compare` function for `hashed` [Pagan Gazzard]
11
+
7
12
  # v7.1.1
8
- ## (2024-06-03)
13
+ ## (2024-06-04)
9
14
 
10
15
  * Accept `Date` for the write types of `Date Time`/`Date`/`Time` [Pagan Gazzard]
11
16
 
@@ -1,4 +1,4 @@
1
- import type * as Bcrypt from 'bcrypt';
1
+ /// <reference types="node" />
2
2
  import * as TypeUtils from '../type-utils';
3
3
  export declare const types: {
4
4
  postgres: string;
@@ -11,5 +11,5 @@ export declare const types: {
11
11
  export type Types = TypeUtils.TsTypes<string, string>;
12
12
  type DbWriteType = string;
13
13
  export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
14
- export declare const compare: typeof Bcrypt.compare;
14
+ export declare const compare: (data: string | Buffer, encrypted: string) => Promise<boolean>;
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"hashed.js","sourceRoot":"","sources":["../../src/types/hashed.ts"],"names":[],"mappings":";;;AAEA,2CAA2C;AAE3C,IAAI,MAAqB,CAAC;AAC1B,IAAI,CAAC;IACJ,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AAAC,MAAM,CAAC;IACR,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAEY,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAKW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAES,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"hashed.js","sourceRoot":"","sources":["../../src/types/hashed.ts"],"names":[],"mappings":";;;AAEA,2CAA2C;AAE3C,IAAI,MAAqB,CAAC;AAC1B,IAAI,CAAC;IACJ,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AAAC,MAAM,CAAC;IACR,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAEY,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAKW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAES,QAAA,OAAO,GAGI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/sbvr-types",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "description": "SBVR type definitions.",
5
5
  "main": "out",
6
6
  "scripts": {
@@ -51,6 +51,6 @@
51
51
  "npm": ">=8.1.0"
52
52
  },
53
53
  "versionist": {
54
- "publishedAt": "2024-06-03T18:07:36.442Z"
54
+ "publishedAt": "2024-06-12T12:14:00.451Z"
55
55
  }
56
56
  }
@@ -30,4 +30,7 @@ export const validate: TypeUtils.Validate<Types['Write'], DbWriteType> =
30
30
  return bcrypt.hash(value, salt);
31
31
  });
32
32
 
33
- export const compare = bcrypt.compare.bind(bcrypt);
33
+ export const compare: (
34
+ data: string | Buffer,
35
+ encrypted: string,
36
+ ) => Promise<boolean> = bcrypt.compare.bind(bcrypt);