@balena/sbvr-types 7.1.2 → 7.1.3
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/.versionbot/CHANGELOG.yml +12 -1
- package/CHANGELOG.md +5 -0
- package/out/type-utils.d.ts +8 -4
- package/out/type-utils.js.map +1 -1
- package/out/types/big-integer.d.ts +1 -12
- package/out/types/big-integer.js.map +1 -1
- package/out/types/color.d.ts +1 -8
- package/out/types/color.js +11 -7
- package/out/types/color.js.map +1 -1
- package/out/types/concept-type.d.ts +1 -12
- package/out/types/concept-type.js.map +1 -1
- package/out/types/date-time.d.ts +2 -9
- package/out/types/date-time.js +1 -1
- package/out/types/date-time.js.map +1 -1
- package/out/types/date.d.ts +1 -6
- package/out/types/date.js.map +1 -1
- package/out/types/foreign-key.d.ts +1 -12
- package/out/types/foreign-key.js.map +1 -1
- package/out/types/integer.d.ts +1 -12
- package/out/types/integer.js.map +1 -1
- package/out/types/real.d.ts +1 -12
- package/out/types/real.js.map +1 -1
- package/out/types/text.d.ts +2 -13
- package/out/types/text.js +2 -2
- package/out/types/text.js.map +1 -1
- package/out/types/web-resource.d.ts +1 -11
- package/out/types/web-resource.js.map +1 -1
- package/package.json +9 -9
- package/src/type-utils.ts +26 -5
- package/src/types/big-integer.ts +1 -1
- package/src/types/color.ts +19 -11
- package/src/types/concept-type.ts +1 -1
- package/src/types/date-time.ts +8 -4
- package/src/types/date.ts +3 -2
- package/src/types/foreign-key.ts +1 -1
- package/src/types/integer.ts +1 -1
- package/src/types/real.ts +1 -1
- package/src/types/text.ts +12 -6
- package/src/types/web-resource.ts +7 -16
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
- commits:
|
|
2
|
+
- subject: Add typings for all abstract sql fragments, fixing where necessary
|
|
3
|
+
hash: b84c335877236e3d389df064b3e7b2acd1a656ae
|
|
4
|
+
body: ""
|
|
5
|
+
footer:
|
|
6
|
+
Change-type: patch
|
|
7
|
+
change-type: patch
|
|
8
|
+
author: Pagan Gazzard
|
|
9
|
+
version: 7.1.3
|
|
10
|
+
title: ""
|
|
11
|
+
date: 2024-06-12T12:44:16.479Z
|
|
1
12
|
- commits:
|
|
2
13
|
- subject: Explicitly type the `compare` function for `hashed`
|
|
3
14
|
hash: 6ece56f531ba9507fb090003bd3216e90b2f583b
|
|
@@ -10,7 +21,7 @@
|
|
|
10
21
|
author: Pagan Gazzard
|
|
11
22
|
version: 7.1.2
|
|
12
23
|
title: ""
|
|
13
|
-
date: 2024-06-12T12:
|
|
24
|
+
date: 2024-06-12T12:19:17.354Z
|
|
14
25
|
- commits:
|
|
15
26
|
- subject: Accept `Date` for the write types of `Date Time`/`Date`/`Time`
|
|
16
27
|
hash: eb03c8fb593fad76c74dad57a3d45625daf44d76
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +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
|
+
# v7.1.3
|
|
8
|
+
## (2024-06-12)
|
|
9
|
+
|
|
10
|
+
* Add typings for all abstract sql fragments, fixing where necessary [Pagan Gazzard]
|
|
11
|
+
|
|
7
12
|
# v7.1.2
|
|
8
13
|
## (2024-06-12)
|
|
9
14
|
|
package/out/type-utils.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { AnyTypeNodes, EqualsNode, LessThanNode, LessThanOrEqualNode, ReferencedFieldNode } from '@balena/abstract-sql-compiler';
|
|
2
|
+
export type NativeNames = Record<string, AnyTypeNodes>;
|
|
3
|
+
export type NativeProperties = Record<string, Record<string, (from: ReferencedFieldNode) => AnyTypeNodes>>;
|
|
4
|
+
export type NativeFactTypes = Record<string, Record<string, (from: ReferencedFieldNode, to: ReferencedFieldNode) => AnyTypeNodes>>;
|
|
1
5
|
export interface DatabaseTypeFn {
|
|
2
6
|
(necessity: string, index: string): string;
|
|
3
7
|
castType: string;
|
|
@@ -28,12 +32,12 @@ export interface Validate<Write, DbWrite> {
|
|
|
28
32
|
}
|
|
29
33
|
export declare const nativeFactTypeTemplates: {
|
|
30
34
|
equality: {
|
|
31
|
-
'is equal to': (from:
|
|
35
|
+
'is equal to': (from: ReferencedFieldNode, to: ReferencedFieldNode) => EqualsNode;
|
|
32
36
|
};
|
|
33
37
|
comparison: {
|
|
34
|
-
'is equal to': (from:
|
|
35
|
-
'is less than': (from:
|
|
36
|
-
'is less than or equal to': (from:
|
|
38
|
+
'is equal to': (from: ReferencedFieldNode, to: ReferencedFieldNode) => EqualsNode;
|
|
39
|
+
'is less than': (from: ReferencedFieldNode, to: ReferencedFieldNode) => LessThanNode;
|
|
40
|
+
'is less than or equal to': (from: ReferencedFieldNode, to: ReferencedFieldNode) => LessThanOrEqualNode;
|
|
37
41
|
};
|
|
38
42
|
};
|
|
39
43
|
export declare const validate: {
|
package/out/type-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":";;;AAmDA,MAAM,aAAa,GAAG,CAAI,UAA0C,EAAE,EAAE;IAIvE,KAAK,UAAU,QAAQ,CACtB,KAAc,EACd,QAAiB;QAEjB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG;IAChB,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,EAAc,EAAE,CAA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C,KAAK,CAAC,CAAC;QACnC,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAClC,cAAc,GAAG,KAAK,CAAC;QACxB,CAAC;QACD,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,aAAa,CAAC;IACtB,CAAC,CAAC;CACF,CAAC"}
|
|
@@ -9,17 +9,6 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
11
11
|
type DbWriteType = number;
|
|
12
|
-
export declare const nativeFactTypes:
|
|
13
|
-
Integer: {
|
|
14
|
-
'is equal to': (from: string, to: string) => string[];
|
|
15
|
-
'is less than': (from: string, to: string) => string[];
|
|
16
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
Real: {
|
|
19
|
-
'is equal to': (from: string, to: string) => string[];
|
|
20
|
-
'is less than': (from: string, to: string) => string[];
|
|
21
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
12
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
24
13
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
25
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"big-integer.js","sourceRoot":"","sources":["../../src/types/big-integer.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"big-integer.js","sourceRoot":"","sources":["../../src/types/big-integer.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,GAA8B;IACzD,OAAO,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;IACrD,IAAI,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;CAClD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC"}
|
package/out/types/color.d.ts
CHANGED
|
@@ -16,14 +16,7 @@ type ColorObj = {
|
|
|
16
16
|
};
|
|
17
17
|
export type Types = TypeUtils.TsTypes<ColorObj, number | ColorObj>;
|
|
18
18
|
type DbWriteType = number;
|
|
19
|
-
export declare const nativeProperties:
|
|
20
|
-
has: {
|
|
21
|
-
'Red Component': (from: string) => (string | number | (string | number)[])[];
|
|
22
|
-
'Green Component': (from: string) => (string | number | (string | number)[])[];
|
|
23
|
-
'Blue Component': (from: string) => (string | number)[];
|
|
24
|
-
'Alpha Component': (from: string) => (string | number | (string | number)[])[];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
19
|
+
export declare const nativeProperties: TypeUtils.NativeProperties;
|
|
27
20
|
export declare const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']>;
|
|
28
21
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
29
22
|
export {};
|
package/out/types/color.js
CHANGED
|
@@ -21,19 +21,23 @@ exports.nativeProperties = {
|
|
|
21
21
|
has: {
|
|
22
22
|
'Red Component': (from) => [
|
|
23
23
|
'BitwiseAnd',
|
|
24
|
-
['BitwiseShiftRight', from, 16],
|
|
25
|
-
255,
|
|
24
|
+
['BitwiseShiftRight', from, ['Number', 16]],
|
|
25
|
+
['Number', 255],
|
|
26
26
|
],
|
|
27
27
|
'Green Component': (from) => [
|
|
28
28
|
'BitwiseAnd',
|
|
29
|
-
['BitwiseShiftRight', from, 8],
|
|
30
|
-
255,
|
|
29
|
+
['BitwiseShiftRight', from, ['Number', 8]],
|
|
30
|
+
['Number', 255],
|
|
31
|
+
],
|
|
32
|
+
'Blue Component': (from) => [
|
|
33
|
+
'BitwiseShiftRight',
|
|
34
|
+
from,
|
|
35
|
+
['Number', 255],
|
|
31
36
|
],
|
|
32
|
-
'Blue Component': (from) => ['BitwiseShiftRight', from, 255],
|
|
33
37
|
'Alpha Component': (from) => [
|
|
34
38
|
'BitwiseAnd',
|
|
35
|
-
['BitwiseShiftRight', from, 24],
|
|
36
|
-
255,
|
|
39
|
+
['BitwiseShiftRight', from, ['Number', 24]],
|
|
40
|
+
['Number', 255],
|
|
37
41
|
],
|
|
38
42
|
},
|
|
39
43
|
};
|
package/out/types/color.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":";;;AAIA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE;;;;;;eAMA;KACb;CACD,CAAC;AAWW,QAAA,gBAAgB,GAA+B;IAC3D,GAAG,EAAE;QACJ,eAAe,EAAE,CAAC,IAAI,EAAkB,EAAE,CAAC;YAC1C,YAAY;YACZ,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC3C,CAAC,QAAQ,EAAE,GAAG,CAAC;SACf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AC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,KAAK,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;SAAM,CAAC;QACP,cAAc,GAAG,CAAC,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACxC,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YACxC,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,GAAG,EAAE,CAAC;gBAC1D,MAAM,IAAI,KAAK,CACd,iCAAiC;oBAChC,cAAc;oBACd,iBAAiB;oBACjB,SAAS,CACV,CAAC;YACH,CAAC;YAED,QAAQ,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;gBACjC,KAAK,GAAG,CAAC;gBACT,KAAK,KAAK;oBACT,cAAc,IAAI,cAAc,IAAI,EAAE,CAAC;oBACvC,MAAM;gBACP,KAAK,GAAG,CAAC;gBACT,KAAK,OAAO;oBACX,cAAc,IAAI,cAAc,IAAI,CAAC,CAAC;oBACtC,MAAM;gBACP,KAAK,GAAG,CAAC;gBACT,KAAK,MAAM;oBACV,cAAc,IAAI,cAAc,CAAC;oBACjC,MAAM;gBACP,KAAK,GAAG,CAAC;gBACT,KAAK,OAAO;oBACX,cAAc,IAAI,cAAc,IAAI,EAAE,CAAC;oBACvC,MAAM;gBACP;oBACC,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAC;YAC5D,CAAC;QAEF,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -9,17 +9,6 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
11
11
|
type DbWriteType = number;
|
|
12
|
-
export declare const nativeFactTypes:
|
|
13
|
-
Integer: {
|
|
14
|
-
'is equal to': (from: string, to: string) => string[];
|
|
15
|
-
'is less than': (from: string, to: string) => string[];
|
|
16
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
Real: {
|
|
19
|
-
'is equal to': (from: string, to: string) => string[];
|
|
20
|
-
'is less than': (from: string, to: string) => string[];
|
|
21
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
12
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
24
13
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
25
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concept-type.js","sourceRoot":"","sources":["../../src/types/concept-type.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"concept-type.js","sourceRoot":"","sources":["../../src/types/concept-type.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,GAA8B;IACzD,OAAO,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;IACrD,IAAI,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;CAClD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC"}
|
package/out/types/date-time.d.ts
CHANGED
|
@@ -10,14 +10,7 @@ export declare const types: {
|
|
|
10
10
|
export type Types = TypeUtils.TsTypes<string, string | number | Date>;
|
|
11
11
|
type DbWriteType = Date;
|
|
12
12
|
export declare const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']>;
|
|
13
|
-
export declare const nativeFactTypes:
|
|
14
|
-
|
|
15
|
-
'is before': (from: string, to: string) => string[];
|
|
16
|
-
'is equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const nativeNames: {
|
|
20
|
-
'Current Time': string[];
|
|
21
|
-
};
|
|
13
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
14
|
+
export declare const nativeNames: TypeUtils.NativeNames;
|
|
22
15
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
23
16
|
export {};
|
package/out/types/date-time.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.js","sourceRoot":"","sources":["../../src/types/date-time.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"date-time.js","sourceRoot":"","sources":["../../src/types/date-time.ts"],"names":[],"mappings":";;;AAIA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,cAAc;KACpB;CACD,CAAC;AAKK,MAAM,eAAe,GAA6C,CACxE,IAAI,EACH,EAAE;IACH,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAU,CAAC;IACf,IAAI,IAAI,YAAY,IAAI,EAAE,CAAC;QAC1B,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjE,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,OAAO,IAAI,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B;AAEW,QAAA,eAAe,GAA8B;IACzD,WAAW,EAAE;QACZ,GAAG,SAAS,CAAC,uBAAuB,CAAC,QAAQ;QAC7C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,EAAgB,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;KAC/D;CACD,CAAC;AAEW,QAAA,WAAW,GAA0B;IACjD,cAAc,EAAE,CAAC,kBAAkB,CAAgC;CACnE,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC"}
|
package/out/types/date.d.ts
CHANGED
|
@@ -10,11 +10,6 @@ export declare const types: {
|
|
|
10
10
|
export type Types = TypeUtils.TsTypes<string, string | number | Date>;
|
|
11
11
|
type DbWriteType = Date;
|
|
12
12
|
export declare const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']>;
|
|
13
|
-
export declare const nativeFactTypes:
|
|
14
|
-
Date: {
|
|
15
|
-
'is before': (from: string, to: string) => string[];
|
|
16
|
-
'is equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
13
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
19
14
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
20
15
|
export {};
|
package/out/types/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/types/date.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/types/date.ts"],"names":[],"mappings":";;;AACA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,cAAc;KACpB;CACD,CAAC;AAKK,MAAM,eAAe,GAA6C,CACxE,IAAI,EACH,EAAE;IACH,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAU,CAAC;IACf,IAAI,IAAI,YAAY,IAAI,EAAE,CAAC;QAC1B,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjE,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,OAAO,IAAI,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B;AAEW,QAAA,eAAe,GAA8B;IACzD,IAAI,EAAE;QACL,GAAG,SAAS,CAAC,uBAAuB,CAAC,QAAQ;QAC7C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,EAAgB,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;KAC/D;CACD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC"}
|
|
@@ -9,17 +9,6 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
11
11
|
type DbWriteType = number;
|
|
12
|
-
export declare const nativeFactTypes:
|
|
13
|
-
Integer: {
|
|
14
|
-
'is equal to': (from: string, to: string) => string[];
|
|
15
|
-
'is less than': (from: string, to: string) => string[];
|
|
16
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
Real: {
|
|
19
|
-
'is equal to': (from: string, to: string) => string[];
|
|
20
|
-
'is less than': (from: string, to: string) => string[];
|
|
21
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
12
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
24
13
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
25
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key.js","sourceRoot":"","sources":["../../src/types/foreign-key.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"foreign-key.js","sourceRoot":"","sources":["../../src/types/foreign-key.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,GAA8B;IACzD,OAAO,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;IACrD,IAAI,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;CAClD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC"}
|
package/out/types/integer.d.ts
CHANGED
|
@@ -9,17 +9,6 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
11
11
|
type DbWriteType = number;
|
|
12
|
-
export declare const nativeFactTypes:
|
|
13
|
-
Integer: {
|
|
14
|
-
'is equal to': (from: string, to: string) => string[];
|
|
15
|
-
'is less than': (from: string, to: string) => string[];
|
|
16
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
Real: {
|
|
19
|
-
'is equal to': (from: string, to: string) => string[];
|
|
20
|
-
'is less than': (from: string, to: string) => string[];
|
|
21
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
12
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
24
13
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
25
14
|
export {};
|
package/out/types/integer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../src/types/integer.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../src/types/integer.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACN,IAAI,EAAE,WAAW;KACjB;CACD,CAAC;AAKW,QAAA,eAAe,GAA8B;IACzD,OAAO,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;IACrD,IAAI,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;CAClD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC"}
|
package/out/types/real.d.ts
CHANGED
|
@@ -9,17 +9,6 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
11
11
|
type DbWriteType = number;
|
|
12
|
-
export declare const nativeFactTypes:
|
|
13
|
-
Integer: {
|
|
14
|
-
'is equal to': (from: string, to: string) => string[];
|
|
15
|
-
'is less than': (from: string, to: string) => string[];
|
|
16
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
17
|
-
};
|
|
18
|
-
Real: {
|
|
19
|
-
'is equal to': (from: string, to: string) => string[];
|
|
20
|
-
'is less than': (from: string, to: string) => string[];
|
|
21
|
-
'is less than or equal to': (from: string, to: string) => string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
12
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
24
13
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
25
14
|
export {};
|
package/out/types/real.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real.js","sourceRoot":"","sources":["../../src/types/real.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAKW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"real.js","sourceRoot":"","sources":["../../src/types/real.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAKW,QAAA,eAAe,GAA8B;IACzD,OAAO,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;IACrD,IAAI,EAAE,SAAS,CAAC,uBAAuB,CAAC,UAAU;CAClD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
package/out/types/text.d.ts
CHANGED
|
@@ -9,18 +9,7 @@ export declare const types: {
|
|
|
9
9
|
};
|
|
10
10
|
export type Types = TypeUtils.TsTypes<string, string>;
|
|
11
11
|
type DbWriteType = string;
|
|
12
|
-
export declare const nativeProperties:
|
|
13
|
-
|
|
14
|
-
Length: (from: string) => string[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const nativeFactTypes: {
|
|
18
|
-
Text: {
|
|
19
|
-
'starts with': (from: string, to: string) => string[];
|
|
20
|
-
'ends with': (from: string, to: string) => string[];
|
|
21
|
-
contains: (from: string, to: string) => string[];
|
|
22
|
-
'is equal to': (from: string, to: string) => string[];
|
|
23
|
-
};
|
|
24
|
-
};
|
|
12
|
+
export declare const nativeProperties: TypeUtils.NativeProperties;
|
|
13
|
+
export declare const nativeFactTypes: TypeUtils.NativeFactTypes;
|
|
25
14
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
26
15
|
export {};
|
package/out/types/text.js
CHANGED
|
@@ -18,8 +18,8 @@ exports.nativeProperties = {
|
|
|
18
18
|
exports.nativeFactTypes = {
|
|
19
19
|
Text: {
|
|
20
20
|
...TypeUtils.nativeFactTypeTemplates.equality,
|
|
21
|
-
'starts with': (from, to) => ['
|
|
22
|
-
'ends with': (from, to) => ['
|
|
21
|
+
'starts with': (from, to) => ['StartsWith', from, to],
|
|
22
|
+
'ends with': (from, to) => ['EndsWith', from, to],
|
|
23
23
|
contains: (from, to) => ['Contains', from, to],
|
|
24
24
|
},
|
|
25
25
|
};
|
package/out/types/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":";;;AAMA,2CAA2C;AAE9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE;QACN,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAKW,QAAA,gBAAgB,GAA+B;IAC3D,GAAG,EAAE;QACJ,MAAM,EAAE,CAAC,IAAI,EAAuB,EAAE,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC;KAChE;CACD,CAAC;AAEW,QAAA,eAAe,GAA8B;IACzD,IAAI,EAAE;QACL,GAAG,SAAS,CAAC,uBAAuB,CAAC,QAAQ;QAC7C,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,EAAkB,EAAE,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;QACrE,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,EAAgB,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;QAC/D,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,EAAgB,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;KAC5D;CACD,CAAC;AAEW,QAAA,QAAQ,GACpB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as TypeUtils from '../type-utils';
|
|
2
|
-
import type { CastNode, ExtractJSONPathAsTextNode, ReferencedFieldNode } from '@balena/abstract-sql-compiler';
|
|
3
2
|
export type WebResource = {
|
|
4
3
|
filename: string;
|
|
5
4
|
href: string;
|
|
@@ -19,16 +18,7 @@ export declare const types: {
|
|
|
19
18
|
};
|
|
20
19
|
export type Types = TypeUtils.TsTypes<WebResource, WebResource>;
|
|
21
20
|
type DbWriteType = string;
|
|
22
|
-
export declare const nativeProperties:
|
|
23
|
-
has: {
|
|
24
|
-
Filename: (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode;
|
|
25
|
-
HRef: (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode;
|
|
26
|
-
'Content Type': (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode;
|
|
27
|
-
'Content Disposition': (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode;
|
|
28
|
-
Checksum: (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode;
|
|
29
|
-
Size: (referencedField: ReferencedFieldNode) => CastNode;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
21
|
+
export declare const nativeProperties: TypeUtils.NativeProperties;
|
|
32
22
|
export declare const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']>;
|
|
33
23
|
export declare const validate: TypeUtils.Validate<Types['Write'], DbWriteType>;
|
|
34
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-resource.js","sourceRoot":"","sources":["../../src/types/web-resource.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;
|
|
1
|
+
{"version":3,"file":"web-resource.js","sourceRoot":"","sources":["../../src/types/web-resource.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAe9B,QAAA,KAAK,GAAG;IACpB,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE;QACN,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE;;;;;;;;eAQA;KACb;CACD,CAAC;AAKW,QAAA,gBAAgB,GAA+B;IAC3D,GAAG,EAAE;QACJ,QAAQ,EAAE,CAAC,eAAe,EAA6B,EAAE,CAAC;YACzD,uBAAuB;YACvB,eAAe;YACf,CAAC,WAAW,EAAE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AAQ,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAC/D,CAAC;IACD,IACC,KAAK,CAAC,mBAAmB,IAAI,IAAI;QACjC,OAAO,KAAK,CAAC,mBAAmB,KAAK,QAAQ,EAC5C,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACjD,CAAC;AACF,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/sbvr-types",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"description": "SBVR type definitions.",
|
|
5
5
|
"main": "out",
|
|
6
6
|
"scripts": {
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"sha.js": "^2.4.11"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@balena/abstract-sql-compiler": "^9.0
|
|
24
|
-
"@balena/lint": "^8.0.
|
|
23
|
+
"@balena/abstract-sql-compiler": "^9.2.0",
|
|
24
|
+
"@balena/lint": "^8.0.2",
|
|
25
25
|
"@types/bcrypt": "^5.0.2",
|
|
26
|
-
"@types/chai": "^4.3.
|
|
26
|
+
"@types/chai": "^4.3.16",
|
|
27
27
|
"@types/chai-datetime": "^0.0.39",
|
|
28
28
|
"@types/mocha": "^10.0.6",
|
|
29
29
|
"@types/sha.js": "^2.4.4",
|
|
30
30
|
"chai": "^4.4.1",
|
|
31
31
|
"chai-datetime": "^1.8.0",
|
|
32
|
-
"husky": "^9.0.
|
|
33
|
-
"lint-staged": "^15.2.
|
|
34
|
-
"mocha": "^10.
|
|
32
|
+
"husky": "^9.0.11",
|
|
33
|
+
"lint-staged": "^15.2.6",
|
|
34
|
+
"mocha": "^10.4.0",
|
|
35
35
|
"ts-node": "^10.9.2",
|
|
36
|
-
"typescript": "^5.4.
|
|
36
|
+
"typescript": "^5.4.5"
|
|
37
37
|
},
|
|
38
38
|
"lint-staged": {
|
|
39
39
|
"*.ts": [
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"npm": ">=8.1.0"
|
|
52
52
|
},
|
|
53
53
|
"versionist": {
|
|
54
|
-
"publishedAt": "2024-06-12T12:
|
|
54
|
+
"publishedAt": "2024-06-12T12:44:16.615Z"
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/type-utils.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AnyTypeNodes,
|
|
3
|
+
EqualsNode,
|
|
4
|
+
LessThanNode,
|
|
5
|
+
LessThanOrEqualNode,
|
|
6
|
+
ReferencedFieldNode,
|
|
7
|
+
} from '@balena/abstract-sql-compiler';
|
|
8
|
+
|
|
9
|
+
export type NativeNames = Record<string, AnyTypeNodes>;
|
|
10
|
+
export type NativeProperties = Record<
|
|
11
|
+
string,
|
|
12
|
+
Record<string, (from: ReferencedFieldNode) => AnyTypeNodes>
|
|
13
|
+
>;
|
|
14
|
+
export type NativeFactTypes = Record<
|
|
15
|
+
string,
|
|
16
|
+
Record<
|
|
17
|
+
string,
|
|
18
|
+
(from: ReferencedFieldNode, to: ReferencedFieldNode) => AnyTypeNodes
|
|
19
|
+
>
|
|
20
|
+
>;
|
|
21
|
+
|
|
1
22
|
export interface DatabaseTypeFn {
|
|
2
23
|
(necessity: string, index: string): string;
|
|
3
24
|
castType: string;
|
|
@@ -48,20 +69,20 @@ const checkRequired = <T>(validateFn: (value: any) => T | Promise<T>) => {
|
|
|
48
69
|
};
|
|
49
70
|
|
|
50
71
|
const equality = {
|
|
51
|
-
'is equal to': (from
|
|
52
|
-
};
|
|
72
|
+
'is equal to': (from, to): EqualsNode => ['Equals', from, to],
|
|
73
|
+
} satisfies NativeFactTypes[string];
|
|
53
74
|
export const nativeFactTypeTemplates = {
|
|
54
75
|
equality,
|
|
55
76
|
comparison: {
|
|
56
|
-
'is less than': (from
|
|
57
|
-
'is less than or equal to': (from
|
|
77
|
+
'is less than': (from, to): LessThanNode => ['LessThan', from, to],
|
|
78
|
+
'is less than or equal to': (from, to): LessThanOrEqualNode => [
|
|
58
79
|
'LessThanOrEqual',
|
|
59
80
|
from,
|
|
60
81
|
to,
|
|
61
82
|
],
|
|
62
83
|
...equality,
|
|
63
84
|
},
|
|
64
|
-
}
|
|
85
|
+
} satisfies Record<string, NativeFactTypes[string]>;
|
|
65
86
|
|
|
66
87
|
export const validate = {
|
|
67
88
|
checkRequired,
|
package/src/types/big-integer.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const types = {
|
|
|
12
12
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
13
13
|
type DbWriteType = number;
|
|
14
14
|
|
|
15
|
-
export const nativeFactTypes = {
|
|
15
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
16
16
|
Integer: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
17
17
|
Real: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
18
18
|
};
|
package/src/types/color.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BitwiseAndNode,
|
|
3
|
+
BitwiseShiftRightNode,
|
|
4
|
+
} from '@balena/abstract-sql-compiler';
|
|
1
5
|
import * as TypeUtils from '../type-utils';
|
|
2
6
|
|
|
3
7
|
export const types = {
|
|
@@ -25,23 +29,27 @@ type ColorObj = {
|
|
|
25
29
|
export type Types = TypeUtils.TsTypes<ColorObj, number | ColorObj>;
|
|
26
30
|
type DbWriteType = number;
|
|
27
31
|
|
|
28
|
-
export const nativeProperties = {
|
|
32
|
+
export const nativeProperties: TypeUtils.NativeProperties = {
|
|
29
33
|
has: {
|
|
30
|
-
'Red Component': (from:
|
|
34
|
+
'Red Component': (from): BitwiseAndNode => [
|
|
31
35
|
'BitwiseAnd',
|
|
32
|
-
['BitwiseShiftRight', from, 16],
|
|
33
|
-
255,
|
|
36
|
+
['BitwiseShiftRight', from, ['Number', 16]],
|
|
37
|
+
['Number', 255],
|
|
34
38
|
],
|
|
35
|
-
'Green Component': (from:
|
|
39
|
+
'Green Component': (from): BitwiseAndNode => [
|
|
36
40
|
'BitwiseAnd',
|
|
37
|
-
['BitwiseShiftRight', from, 8],
|
|
38
|
-
255,
|
|
41
|
+
['BitwiseShiftRight', from, ['Number', 8]],
|
|
42
|
+
['Number', 255],
|
|
39
43
|
],
|
|
40
|
-
'Blue Component': (from:
|
|
41
|
-
|
|
44
|
+
'Blue Component': (from): BitwiseShiftRightNode => [
|
|
45
|
+
'BitwiseShiftRight',
|
|
46
|
+
from,
|
|
47
|
+
['Number', 255],
|
|
48
|
+
],
|
|
49
|
+
'Alpha Component': (from): BitwiseAndNode => [
|
|
42
50
|
'BitwiseAnd',
|
|
43
|
-
['BitwiseShiftRight', from, 24],
|
|
44
|
-
255,
|
|
51
|
+
['BitwiseShiftRight', from, ['Number', 24]],
|
|
52
|
+
['Number', 255],
|
|
45
53
|
],
|
|
46
54
|
},
|
|
47
55
|
};
|
|
@@ -12,7 +12,7 @@ export const types = {
|
|
|
12
12
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
13
13
|
type DbWriteType = number;
|
|
14
14
|
|
|
15
|
-
export const nativeFactTypes = {
|
|
15
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
16
16
|
Integer: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
17
17
|
Real: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
18
18
|
};
|
package/src/types/date-time.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CurrentTimestampNode,
|
|
3
|
+
LessThanNode,
|
|
4
|
+
} from '@balena/abstract-sql-compiler';
|
|
1
5
|
import * as TypeUtils from '../type-utils';
|
|
2
6
|
|
|
3
7
|
export const types = {
|
|
@@ -29,15 +33,15 @@ export const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']> = (
|
|
|
29
33
|
return date.toISOString();
|
|
30
34
|
};
|
|
31
35
|
|
|
32
|
-
export const nativeFactTypes = {
|
|
36
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
33
37
|
'Date Time': {
|
|
34
38
|
...TypeUtils.nativeFactTypeTemplates.equality,
|
|
35
|
-
'is before': (from
|
|
39
|
+
'is before': (from, to): LessThanNode => ['LessThan', from, to],
|
|
36
40
|
},
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
export const nativeNames = {
|
|
40
|
-
'Current Time': ['
|
|
43
|
+
export const nativeNames: TypeUtils.NativeNames = {
|
|
44
|
+
'Current Time': ['CurrentTimestamp'] satisfies CurrentTimestampNode,
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export const validate: TypeUtils.Validate<Types['Write'], DbWriteType> =
|
package/src/types/date.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LessThanNode } from '@balena/abstract-sql-compiler';
|
|
1
2
|
import * as TypeUtils from '../type-utils';
|
|
2
3
|
|
|
3
4
|
export const types = {
|
|
@@ -29,10 +30,10 @@ export const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']> = (
|
|
|
29
30
|
return date.toISOString();
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
export const nativeFactTypes = {
|
|
33
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
33
34
|
Date: {
|
|
34
35
|
...TypeUtils.nativeFactTypeTemplates.equality,
|
|
35
|
-
'is before': (from
|
|
36
|
+
'is before': (from, to): LessThanNode => ['LessThan', from, to],
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
|
package/src/types/foreign-key.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const types = {
|
|
|
12
12
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
13
13
|
type DbWriteType = number;
|
|
14
14
|
|
|
15
|
-
export const nativeFactTypes = {
|
|
15
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
16
16
|
Integer: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
17
17
|
Real: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
18
18
|
};
|
package/src/types/integer.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const types = {
|
|
|
12
12
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
13
13
|
type DbWriteType = number;
|
|
14
14
|
|
|
15
|
-
export const nativeFactTypes = {
|
|
15
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
16
16
|
Integer: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
17
17
|
Real: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
18
18
|
};
|
package/src/types/real.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const types = {
|
|
|
12
12
|
export type Types = TypeUtils.TsTypes<number, number>;
|
|
13
13
|
type DbWriteType = number;
|
|
14
14
|
|
|
15
|
-
export const nativeFactTypes = {
|
|
15
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
16
16
|
Integer: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
17
17
|
Real: TypeUtils.nativeFactTypeTemplates.comparison,
|
|
18
18
|
};
|
package/src/types/text.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CharacterLengthNode,
|
|
3
|
+
StartsWithNode,
|
|
4
|
+
EndsWithNode,
|
|
5
|
+
ContainsNode,
|
|
6
|
+
} from '@balena/abstract-sql-compiler';
|
|
1
7
|
import * as TypeUtils from '../type-utils';
|
|
2
8
|
|
|
3
9
|
export const types = {
|
|
@@ -12,18 +18,18 @@ export const types = {
|
|
|
12
18
|
export type Types = TypeUtils.TsTypes<string, string>;
|
|
13
19
|
type DbWriteType = string;
|
|
14
20
|
|
|
15
|
-
export const nativeProperties = {
|
|
21
|
+
export const nativeProperties: TypeUtils.NativeProperties = {
|
|
16
22
|
has: {
|
|
17
|
-
Length: (from:
|
|
23
|
+
Length: (from): CharacterLengthNode => ['CharacterLength', from],
|
|
18
24
|
},
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
export const nativeFactTypes = {
|
|
27
|
+
export const nativeFactTypes: TypeUtils.NativeFactTypes = {
|
|
22
28
|
Text: {
|
|
23
29
|
...TypeUtils.nativeFactTypeTemplates.equality,
|
|
24
|
-
'starts with': (from
|
|
25
|
-
'ends with': (from
|
|
26
|
-
contains: (from
|
|
30
|
+
'starts with': (from, to): StartsWithNode => ['StartsWith', from, to],
|
|
31
|
+
'ends with': (from, to): EndsWithNode => ['EndsWith', from, to],
|
|
32
|
+
contains: (from, to): ContainsNode => ['Contains', from, to],
|
|
27
33
|
},
|
|
28
34
|
};
|
|
29
35
|
|
|
@@ -2,7 +2,6 @@ import * as TypeUtils from '../type-utils';
|
|
|
2
2
|
import type {
|
|
3
3
|
CastNode,
|
|
4
4
|
ExtractJSONPathAsTextNode,
|
|
5
|
-
ReferencedFieldNode,
|
|
6
5
|
} from '@balena/abstract-sql-compiler';
|
|
7
6
|
|
|
8
7
|
export type WebResource = {
|
|
@@ -35,42 +34,34 @@ export const types = {
|
|
|
35
34
|
export type Types = TypeUtils.TsTypes<WebResource, WebResource>;
|
|
36
35
|
type DbWriteType = string;
|
|
37
36
|
|
|
38
|
-
export const nativeProperties = {
|
|
37
|
+
export const nativeProperties: TypeUtils.NativeProperties = {
|
|
39
38
|
has: {
|
|
40
|
-
Filename: (
|
|
41
|
-
referencedField: ReferencedFieldNode,
|
|
42
|
-
): ExtractJSONPathAsTextNode => [
|
|
39
|
+
Filename: (referencedField): ExtractJSONPathAsTextNode => [
|
|
43
40
|
'ExtractJSONPathAsText',
|
|
44
41
|
referencedField,
|
|
45
42
|
['TextArray', ['EmbeddedText', 'filename']],
|
|
46
43
|
],
|
|
47
|
-
HRef: (referencedField
|
|
44
|
+
HRef: (referencedField): ExtractJSONPathAsTextNode => [
|
|
48
45
|
'ExtractJSONPathAsText',
|
|
49
46
|
referencedField,
|
|
50
47
|
['TextArray', ['EmbeddedText', 'href']],
|
|
51
48
|
],
|
|
52
|
-
'Content Type': (
|
|
53
|
-
referencedField: ReferencedFieldNode,
|
|
54
|
-
): ExtractJSONPathAsTextNode => [
|
|
49
|
+
'Content Type': (referencedField): ExtractJSONPathAsTextNode => [
|
|
55
50
|
'ExtractJSONPathAsText',
|
|
56
51
|
referencedField,
|
|
57
52
|
['TextArray', ['EmbeddedText', 'content_type']],
|
|
58
53
|
],
|
|
59
|
-
'Content Disposition': (
|
|
60
|
-
referencedField: ReferencedFieldNode,
|
|
61
|
-
): ExtractJSONPathAsTextNode => [
|
|
54
|
+
'Content Disposition': (referencedField): ExtractJSONPathAsTextNode => [
|
|
62
55
|
'ExtractJSONPathAsText',
|
|
63
56
|
referencedField,
|
|
64
57
|
['TextArray', ['EmbeddedText', 'content_disposition']],
|
|
65
58
|
],
|
|
66
|
-
Checksum: (
|
|
67
|
-
referencedField: ReferencedFieldNode,
|
|
68
|
-
): ExtractJSONPathAsTextNode => [
|
|
59
|
+
Checksum: (referencedField): ExtractJSONPathAsTextNode => [
|
|
69
60
|
'ExtractJSONPathAsText',
|
|
70
61
|
referencedField,
|
|
71
62
|
['TextArray', ['EmbeddedText', 'checksum']],
|
|
72
63
|
],
|
|
73
|
-
Size: (referencedField
|
|
64
|
+
Size: (referencedField): CastNode => [
|
|
74
65
|
'Cast',
|
|
75
66
|
[
|
|
76
67
|
'ExtractJSONPathAsText',
|