@tstdl/base 0.93.15 → 0.93.17
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/document-management/api/document-management.api.d.ts +4 -0
- package/document-management/service-models/document.service-model.d.ts +2 -0
- package/injector/injector.js +13 -10
- package/mail/mail.service.js +1 -1
- package/orm/data-types/index.d.ts +1 -0
- package/orm/data-types/index.js +1 -0
- package/orm/data-types/tsvector.d.ts +16 -0
- package/orm/data-types/tsvector.js +13 -0
- package/orm/decorators.d.ts +44 -32
- package/orm/decorators.js +3 -6
- package/orm/entity.d.ts +20 -13
- package/orm/entity.js +18 -18
- package/orm/repository.types.d.ts +13 -13
- package/orm/server/drizzle/schema-converter.js +115 -63
- package/orm/server/types.d.ts +2 -3
- package/package.json +4 -4
- package/test/drizzle/0002_nice_squadron_supreme.sql +1 -0
- package/test/drizzle/0003_serious_mockingbird.sql +1 -0
- package/test/drizzle/0004_complete_pixie.sql +1 -0
- package/test/drizzle/0005_bumpy_sabra.sql +1 -0
- package/test/drizzle/0006_overrated_post.sql +6 -0
- package/test/drizzle/meta/0002_snapshot.json +63 -0
- package/test/drizzle/meta/0003_snapshot.json +73 -0
- package/test/drizzle/meta/0004_snapshot.json +89 -0
- package/test/drizzle/meta/0005_snapshot.json +104 -0
- package/test/drizzle/meta/0006_snapshot.json +104 -0
- package/test/drizzle/meta/_journal.json +35 -0
- package/test/test.model.d.ts +2 -2
- package/test/test.model.js +6 -4
- package/utils/value-or-provider.d.ts +7 -4
- package/utils/value-or-provider.js +9 -12
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "abdf0c39-ecd3-439a-9b30-1add930c55c0",
|
|
3
|
+
"prevId": "11b20d13-8277-4ab5-bf78-998c6d7816d4",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"test.test": {
|
|
8
|
+
"name": "test",
|
|
9
|
+
"schema": "test",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "uuid",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true,
|
|
16
|
+
"default": "gen_random_uuid()"
|
|
17
|
+
},
|
|
18
|
+
"title": {
|
|
19
|
+
"name": "title",
|
|
20
|
+
"type": "text",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"content": {
|
|
25
|
+
"name": "content",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true
|
|
29
|
+
},
|
|
30
|
+
"tags": {
|
|
31
|
+
"name": "tags",
|
|
32
|
+
"type": "text",
|
|
33
|
+
"primaryKey": false,
|
|
34
|
+
"notNull": true
|
|
35
|
+
},
|
|
36
|
+
"language": {
|
|
37
|
+
"name": "language",
|
|
38
|
+
"type": "text",
|
|
39
|
+
"primaryKey": false,
|
|
40
|
+
"notNull": true
|
|
41
|
+
},
|
|
42
|
+
"fts_v_asd": {
|
|
43
|
+
"name": "fts_v_asd",
|
|
44
|
+
"type": "tsvector",
|
|
45
|
+
"primaryKey": false,
|
|
46
|
+
"notNull": false,
|
|
47
|
+
"generated": {
|
|
48
|
+
"as": "(setweight(to_tsvector('simple', \"test\".\"test\".\"title\"), 'A') || setweight(to_tsvector('simple', \"test\".\"test\".\"content\"), 'B') || setweight(to_tsvector('simple', \"test\".\"test\".\"tags\"), 'C'))",
|
|
49
|
+
"type": "stored"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"indexes": {
|
|
54
|
+
"fts_v_asd_gin": {
|
|
55
|
+
"name": "fts_v_asd_gin",
|
|
56
|
+
"columns": [
|
|
57
|
+
{
|
|
58
|
+
"expression": "fts_v_asd",
|
|
59
|
+
"isExpression": false,
|
|
60
|
+
"asc": true,
|
|
61
|
+
"nulls": "last"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"isUnique": false,
|
|
65
|
+
"concurrently": false,
|
|
66
|
+
"method": "gin",
|
|
67
|
+
"with": {}
|
|
68
|
+
},
|
|
69
|
+
"fts_t_asd_gist": {
|
|
70
|
+
"name": "fts_t_asd_gist",
|
|
71
|
+
"columns": [
|
|
72
|
+
{
|
|
73
|
+
"expression": "(\"title\" || \"content\" || \"tags\")",
|
|
74
|
+
"asc": true,
|
|
75
|
+
"isExpression": true,
|
|
76
|
+
"nulls": "last"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"isUnique": false,
|
|
80
|
+
"concurrently": false,
|
|
81
|
+
"method": "gist",
|
|
82
|
+
"with": {}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"foreignKeys": {},
|
|
86
|
+
"compositePrimaryKeys": {},
|
|
87
|
+
"uniqueConstraints": {},
|
|
88
|
+
"policies": {},
|
|
89
|
+
"checkConstraints": {},
|
|
90
|
+
"isRLSEnabled": false
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"enums": {},
|
|
94
|
+
"schemas": {},
|
|
95
|
+
"sequences": {},
|
|
96
|
+
"roles": {},
|
|
97
|
+
"policies": {},
|
|
98
|
+
"views": {},
|
|
99
|
+
"_meta": {
|
|
100
|
+
"columns": {},
|
|
101
|
+
"schemas": {},
|
|
102
|
+
"tables": {}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -15,6 +15,41 @@
|
|
|
15
15
|
"when": 1760974454017,
|
|
16
16
|
"tag": "0001_organic_rhodey",
|
|
17
17
|
"breakpoints": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"idx": 2,
|
|
21
|
+
"version": "7",
|
|
22
|
+
"when": 1761138612314,
|
|
23
|
+
"tag": "0002_nice_squadron_supreme",
|
|
24
|
+
"breakpoints": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"idx": 3,
|
|
28
|
+
"version": "7",
|
|
29
|
+
"when": 1761142229231,
|
|
30
|
+
"tag": "0003_serious_mockingbird",
|
|
31
|
+
"breakpoints": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idx": 4,
|
|
35
|
+
"version": "7",
|
|
36
|
+
"when": 1761143426736,
|
|
37
|
+
"tag": "0004_complete_pixie",
|
|
38
|
+
"breakpoints": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"idx": 5,
|
|
42
|
+
"version": "7",
|
|
43
|
+
"when": 1761153443342,
|
|
44
|
+
"tag": "0005_bumpy_sabra",
|
|
45
|
+
"breakpoints": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"idx": 6,
|
|
49
|
+
"version": "7",
|
|
50
|
+
"when": 1761153500086,
|
|
51
|
+
"tag": "0006_overrated_post",
|
|
52
|
+
"breakpoints": true
|
|
18
53
|
}
|
|
19
54
|
]
|
|
20
55
|
}
|
package/test/test.model.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class Test extends
|
|
1
|
+
import { BaseEntity, type NewEntity } from '../orm/index.js';
|
|
2
|
+
export declare class Test extends BaseEntity {
|
|
3
3
|
title: string;
|
|
4
4
|
content: string;
|
|
5
5
|
tags: string;
|
package/test/test.model.js
CHANGED
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { BaseEntity, FullTextSearch } from '../orm/index.js';
|
|
11
11
|
import { StringProperty } from '../schema/index.js';
|
|
12
|
-
let Test = class Test extends
|
|
12
|
+
let Test = class Test extends BaseEntity {
|
|
13
13
|
title;
|
|
14
14
|
content;
|
|
15
15
|
tags;
|
|
@@ -32,8 +32,10 @@ __decorate([
|
|
|
32
32
|
__metadata("design:type", String)
|
|
33
33
|
], Test.prototype, "language", void 0);
|
|
34
34
|
Test = __decorate([
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
FullTextSearch('asd', {
|
|
36
|
+
source: ['title', 'content', 'tags'],
|
|
37
|
+
vector: { weights: { title: 'A', content: 'B', tags: 'C' } },
|
|
38
|
+
trigram: {},
|
|
37
39
|
})
|
|
38
40
|
], Test);
|
|
39
41
|
export { Test };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
export type Provider<T> = () => T;
|
|
2
|
-
export type AsyncProvider<T> = () => (T | Promise<T>);
|
|
3
|
-
export type ValueOrProvider<T> = T | Provider<T>;
|
|
4
|
-
export type ValueOrAsyncProvider<T> = T | Provider<T> | AsyncProvider<T>;
|
|
1
|
+
export type Provider<T, A = void> = (arg: A) => T;
|
|
2
|
+
export type AsyncProvider<T, A = void> = (arg: A) => (T | Promise<T>);
|
|
3
|
+
export type ValueOrProvider<T, A = void> = T | Provider<T, A>;
|
|
4
|
+
export type ValueOrAsyncProvider<T, A = void> = T | Provider<T, A> | AsyncProvider<T, A>;
|
|
5
5
|
export type ResolvedValueOrProvider<T extends ValueOrAsyncProvider<any>> = T extends ValueOrAsyncProvider<infer U> ? U : never;
|
|
6
6
|
export declare function resolveValueOrProvider<T>(valueOrProvider: ValueOrProvider<T>): T;
|
|
7
|
+
export declare function resolveValueOrProvider<T, A>(valueOrProvider: ValueOrProvider<T, A>, arg: A): T;
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated use {@link resolveValueOrAsyncProvider}
|
|
9
10
|
*/
|
|
10
11
|
export declare function resolveAsyncValueOrProvider<T>(valueOrProvider: ValueOrAsyncProvider<T>): Promise<T>;
|
|
12
|
+
export declare function resolveAsyncValueOrProvider<T, A>(valueOrProvider: ValueOrAsyncProvider<T, A>, arg: A): Promise<T>;
|
|
11
13
|
export declare function resolveValueOrAsyncProvider<T>(valueOrProvider: ValueOrAsyncProvider<T>): Promise<T>;
|
|
14
|
+
export declare function resolveValueOrAsyncProvider<T, A>(valueOrProvider: ValueOrAsyncProvider<T, A>, arg: A): Promise<T>;
|
|
12
15
|
/**
|
|
13
16
|
* @deprecated use {@link cacheValueOrAsyncProvider}
|
|
14
17
|
*/
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { isFunction } from './type-guards.js';
|
|
2
|
-
export function resolveValueOrProvider(valueOrProvider) {
|
|
2
|
+
export function resolveValueOrProvider(valueOrProvider, arg) {
|
|
3
3
|
if (isFunction(valueOrProvider)) {
|
|
4
|
-
return valueOrProvider();
|
|
4
|
+
return valueOrProvider(arg);
|
|
5
5
|
}
|
|
6
6
|
return valueOrProvider;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export async function resolveAsyncValueOrProvider(valueOrProvider) {
|
|
12
|
-
return resolveValueOrAsyncProvider(valueOrProvider);
|
|
8
|
+
export async function resolveAsyncValueOrProvider(valueOrProvider, arg) {
|
|
9
|
+
return await resolveValueOrAsyncProvider(valueOrProvider, arg);
|
|
13
10
|
}
|
|
14
|
-
export async function resolveValueOrAsyncProvider(valueOrProvider) {
|
|
11
|
+
export async function resolveValueOrAsyncProvider(valueOrProvider, arg) {
|
|
15
12
|
if (isFunction(valueOrProvider)) {
|
|
16
|
-
return valueOrProvider();
|
|
13
|
+
return await valueOrProvider(arg);
|
|
17
14
|
}
|
|
18
15
|
return valueOrProvider;
|
|
19
16
|
}
|
|
@@ -26,9 +23,9 @@ export function cacheAsyncValueOrProvider(provider) {
|
|
|
26
23
|
export function cacheValueOrAsyncProvider(provider) {
|
|
27
24
|
let getValue = async () => {
|
|
28
25
|
const valuePromise = resolveValueOrAsyncProvider(provider);
|
|
29
|
-
getValue = async () => valuePromise;
|
|
26
|
+
getValue = async () => await valuePromise;
|
|
30
27
|
void valuePromise.then((resolvedValue) => (getValue = () => resolvedValue));
|
|
31
|
-
return valuePromise;
|
|
28
|
+
return await valuePromise;
|
|
32
29
|
};
|
|
33
|
-
return async () => getValue();
|
|
30
|
+
return async () => await getValue();
|
|
34
31
|
}
|