@tstdl/base 0.92.85 → 0.92.86
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/ai/ai.service.d.ts +1 -1
- package/ai/ai.service.js +3 -3
- package/ai/types.d.ts +1 -1
- package/authentication/authentication.api.d.ts +9 -9
- package/authentication/models/schemas.d.ts +2 -2
- package/cancellation/token.d.ts +1 -1
- package/document-management/api/document-management.api.d.ts +94 -94
- package/document-management/models/document-category.model.d.ts +1 -0
- package/document-management/models/document-index.model.d.ts +7 -0
- package/document-management/models/document-index.model.js +32 -0
- package/document-management/models/document-request-file.model.d.ts +1 -1
- package/document-management/models/document-request-file.model.js +2 -2
- package/document-management/models/document-type.model.d.ts +1 -0
- package/document-management/models/document.model.d.ts +1 -1
- package/document-management/models/document.model.js +2 -2
- package/document-management/models/service-models/document.service-model.d.ts +51 -51
- package/document-management/models/service-models/document.service-model.js +2 -2
- package/document-management/server/drizzle/{0000_sloppy_fenris.sql → 0000_useful_overlord.sql} +2 -2
- package/document-management/server/drizzle/meta/0000_snapshot.json +5 -5
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/drizzle.config.js +1 -1
- package/document-management/server/module.d.ts +1 -1
- package/document-management/server/module.js +1 -1
- package/document-management/server/schemas.d.ts +33 -0
- package/document-management/{models → server}/schemas.js +14 -14
- package/document-management/server/services/document-management.service.d.ts +17 -3
- package/document-management/server/services/document-management.service.js +65 -17
- package/examples/orm/schemas.d.ts +1 -1
- package/mail/drizzle.config.js +1 -1
- package/mail/models/schemas.d.ts +1 -1
- package/orm/decorators.d.ts +4 -4
- package/orm/entity.d.ts +5 -7
- package/orm/entity.js +9 -1
- package/orm/index.d.ts +1 -0
- package/orm/index.js +1 -0
- package/orm/query.d.ts +1 -3
- package/orm/query.js +0 -1
- package/orm/repository.types.d.ts +32 -0
- package/orm/repository.types.js +1 -0
- package/orm/server/database-schema.d.ts +4 -4
- package/orm/server/drizzle/schema-converter.d.ts +1 -1
- package/orm/server/index.d.ts +1 -0
- package/orm/server/index.js +1 -0
- package/orm/server/query-converter.d.ts +1 -2
- package/orm/server/query-converter.js +66 -61
- package/orm/server/repository.d.ts +78 -42
- package/orm/server/repository.js +202 -106
- package/orm/server/sqls.d.ts +7 -0
- package/orm/server/sqls.js +6 -0
- package/orm/server/types.d.ts +3 -3
- package/orm/types.d.ts +1 -1
- package/package.json +11 -9
- package/queue/enqueue-batch.d.ts +1 -0
- package/queue/enqueue-batch.js +1 -1
- package/queue/mongo/queue.d.ts +9 -4
- package/queue/mongo/queue.js +5 -6
- package/queue/postgres/drizzle/0000_zippy_moondragon.sql +11 -0
- package/queue/postgres/drizzle/meta/0000_snapshot.json +90 -0
- package/queue/postgres/drizzle/meta/_journal.json +13 -0
- package/queue/postgres/drizzle.config.d.ts +2 -0
- package/queue/postgres/drizzle.config.js +11 -0
- package/queue/postgres/index.d.ts +4 -0
- package/queue/postgres/index.js +4 -0
- package/queue/postgres/job.model.d.ts +13 -0
- package/queue/postgres/job.model.js +55 -0
- package/queue/postgres/module.d.ts +9 -0
- package/queue/postgres/module.js +29 -0
- package/queue/postgres/queue.d.ts +28 -0
- package/queue/postgres/queue.js +149 -0
- package/queue/postgres/queue.provider.d.ts +7 -0
- package/queue/postgres/queue.provider.js +21 -0
- package/queue/postgres/schemas.d.ts +3 -0
- package/queue/postgres/schemas.js +4 -0
- package/queue/provider.d.ts +2 -1
- package/queue/queue.d.ts +18 -6
- package/schema/schemas/object.d.ts +1 -1
- package/utils/timing.d.ts +4 -3
- package/utils/timing.js +3 -1
- package/document-management/models/schemas.d.ts +0 -33
package/queue/queue.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CancellationSignal } from '../cancellation/token.js';
|
|
2
2
|
import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
|
|
3
3
|
import { QueueEnqueueBatch } from './enqueue-batch.js';
|
|
4
|
-
export type JobTag = string |
|
|
4
|
+
export type JobTag = string | null;
|
|
5
5
|
export type Job<T> = {
|
|
6
6
|
id: string;
|
|
7
7
|
/**
|
|
@@ -18,6 +18,10 @@ export declare enum UniqueTagStrategy {
|
|
|
18
18
|
TakeNew = 1
|
|
19
19
|
}
|
|
20
20
|
export type EnqueueOptions = {
|
|
21
|
+
tag?: JobTag;
|
|
22
|
+
priority?: number;
|
|
23
|
+
};
|
|
24
|
+
export type EnqueueOneOptions = {
|
|
21
25
|
tag?: JobTag;
|
|
22
26
|
uniqueTag?: UniqueTagStrategy;
|
|
23
27
|
priority?: number;
|
|
@@ -25,21 +29,29 @@ export type EnqueueOptions = {
|
|
|
25
29
|
export type EnqueueManyItem<T> = EnqueueOptions & {
|
|
26
30
|
data: T;
|
|
27
31
|
};
|
|
32
|
+
export type EnqueueManyOptions = {
|
|
33
|
+
uniqueTag?: UniqueTagStrategy;
|
|
34
|
+
returnJobs?: boolean;
|
|
35
|
+
};
|
|
28
36
|
export type QueueConfig = {
|
|
29
37
|
processTimeout?: number;
|
|
30
38
|
maxTries?: number;
|
|
31
39
|
};
|
|
32
40
|
export type QueueArgument = string | (QueueConfig & {
|
|
33
|
-
|
|
41
|
+
name: string;
|
|
34
42
|
});
|
|
35
43
|
export declare const defaultQueueConfig: Required<QueueConfig>;
|
|
36
44
|
export declare abstract class Queue<T> implements Resolvable<QueueArgument> {
|
|
37
45
|
readonly [resolveArgumentType]: QueueArgument;
|
|
38
46
|
batch(): QueueEnqueueBatch<T>;
|
|
39
|
-
abstract enqueue(data: T, options?:
|
|
40
|
-
abstract enqueueMany(items: EnqueueManyItem<T>[],
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
abstract enqueue(data: T, options?: EnqueueOneOptions): Promise<Job<T>>;
|
|
48
|
+
abstract enqueueMany(items: EnqueueManyItem<T>[], options?: EnqueueManyOptions & {
|
|
49
|
+
returnJobs?: false;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
abstract enqueueMany(items: EnqueueManyItem<T>[], options: EnqueueManyOptions & {
|
|
52
|
+
returnJobs: true;
|
|
53
|
+
}): Promise<Job<T>[]>;
|
|
54
|
+
abstract enqueueMany(items: EnqueueManyItem<T>[], options?: EnqueueManyOptions): Promise<Job<T>[] | undefined>;
|
|
43
55
|
abstract has(id: string): Promise<boolean>;
|
|
44
56
|
abstract countByTag(tag: JobTag): Promise<number>;
|
|
45
57
|
abstract get(id: string): Promise<Job<T> | undefined>;
|
|
@@ -29,7 +29,7 @@ export type OptionalProperties<T> = {
|
|
|
29
29
|
} ? P : never;
|
|
30
30
|
}[keyof T];
|
|
31
31
|
export type ObjectSchemaPropertiesType<TP extends ObjectSchemaProperties> = SimplifyObject<{
|
|
32
|
-
[P in keyof PartialProperty<TP, OptionalProperties<TP>>]: SchemaOutput<TP[P]>;
|
|
32
|
+
-readonly [P in keyof PartialProperty<TP, OptionalProperties<TP>>]: SchemaOutput<TP[P]>;
|
|
33
33
|
}>;
|
|
34
34
|
export declare const tryGetSchemaFromReflection: typeof _tryGetSchemaFromReflection;
|
|
35
35
|
export declare class ObjectSchema<T extends Record = Record> extends Schema<T> {
|
package/utils/timing.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Observable } from 'rxjs';
|
|
2
|
+
import { CancellationSignal } from '../cancellation/token.js';
|
|
2
3
|
import { type ValueOrProvider } from './value-or-provider.js';
|
|
3
4
|
/** Timeout for specified duration */
|
|
4
5
|
export declare function timeout(milliseconds?: number, options?: {
|
|
@@ -7,9 +8,9 @@ export declare function timeout(milliseconds?: number, options?: {
|
|
|
7
8
|
/** Timeout until specified time */
|
|
8
9
|
export declare function timeoutUntil(timestamp: number | Date): Promise<void>;
|
|
9
10
|
/** Timeout for specified duration */
|
|
10
|
-
export declare function cancelableTimeout(milliseconds: number, cancelSignal: CancellationSignal): Promise<boolean>;
|
|
11
|
+
export declare function cancelableTimeout(milliseconds: number, cancelSignal: Observable<void> | CancellationSignal): Promise<boolean>;
|
|
11
12
|
/** Timeout until specified time */
|
|
12
|
-
export declare function cancelableTimeoutUntil(timestamp: number | Date, cancelSignal: CancellationSignal): Promise<boolean>;
|
|
13
|
+
export declare function cancelableTimeoutUntil(timestamp: number | Date, cancelSignal: Observable<void> | CancellationSignal): Promise<boolean>;
|
|
13
14
|
export declare function withTimeout<T>(milliseconds: number, promiseOrProvider: ValueOrProvider<Promise<T>>, options?: {
|
|
14
15
|
errorMessage?: string;
|
|
15
16
|
}): Promise<T>;
|
package/utils/timing.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { firstValueFrom, map, race, timer } from 'rxjs';
|
|
2
|
+
import { CancellationSignal } from '../cancellation/token.js';
|
|
2
3
|
import { TimeoutError } from '../errors/timeout.error.js';
|
|
3
4
|
import { _throw } from './throw.js';
|
|
4
5
|
import { resolveValueOrProvider } from './value-or-provider.js';
|
|
@@ -20,9 +21,10 @@ export async function timeoutUntil(timestamp) {
|
|
|
20
21
|
}
|
|
21
22
|
/** Timeout for specified duration */
|
|
22
23
|
export async function cancelableTimeout(milliseconds, cancelSignal) {
|
|
24
|
+
const observable = (cancelSignal instanceof CancellationSignal) ? cancelSignal.set$ : cancelSignal;
|
|
23
25
|
return firstValueFrom(race([
|
|
24
26
|
timer(milliseconds).pipe(map(() => false)),
|
|
25
|
-
|
|
27
|
+
observable.pipe(map(() => true))
|
|
26
28
|
]));
|
|
27
29
|
}
|
|
28
30
|
/** Timeout until specified time */
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DocumentCategory } from './document-category.model.js';
|
|
2
|
-
import { DocumentCollectionDocument } from './document-collection-document.model.js';
|
|
3
|
-
import { DocumentCollection } from './document-collection.model.js';
|
|
4
|
-
import { DocumentFile } from './document-file.model.js';
|
|
5
|
-
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from './document-property-value.model.js';
|
|
6
|
-
import { DocumentProperty } from './document-property.model.js';
|
|
7
|
-
import { DocumentRequestCollection } from './document-request-collection.model.js';
|
|
8
|
-
import { DocumentRequestFile } from './document-request-file.model.js';
|
|
9
|
-
import { DocumentRequestTemplate } from './document-request-template.js';
|
|
10
|
-
import { DocumentRequest } from './document-request.model.js';
|
|
11
|
-
import { DocumentRequestsTemplate } from './document-requests-template.js';
|
|
12
|
-
import { DocumentTypeProperty } from './document-type-property.model.js';
|
|
13
|
-
import { DocumentType } from './document-type.model.js';
|
|
14
|
-
import { Document } from './document.model.js';
|
|
15
|
-
export declare const documentManagementSchema: import("../../orm/server/database-schema.js").DatabaseSchema<"document_management">;
|
|
16
|
-
export declare const dataType: import("drizzle-orm/pg-core").PgEnum<["boolean", "decimal", "text", "integer"]>;
|
|
17
|
-
export declare const documentCategory: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentCategory>;
|
|
18
|
-
export declare const documentCollectionDocument: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentCollectionDocument>;
|
|
19
|
-
export declare const documentCollection: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentCollection>;
|
|
20
|
-
export declare const documentFile: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentFile>;
|
|
21
|
-
export declare const documentPropertyTextValue: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentPropertyTextValue>;
|
|
22
|
-
export declare const documentPropertyIntegerValue: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentPropertyIntegerValue>;
|
|
23
|
-
export declare const documentPropertyDecimalValue: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentPropertyDecimalValue>;
|
|
24
|
-
export declare const documentPropertyBooleanValue: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentPropertyBooleanValue>;
|
|
25
|
-
export declare const documentProperty: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentProperty>;
|
|
26
|
-
export declare const documentRequestCollection: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentRequestCollection>;
|
|
27
|
-
export declare const documentRequestFile: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentRequestFile>;
|
|
28
|
-
export declare const documentRequestTemplate: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentRequestTemplate>;
|
|
29
|
-
export declare const documentRequest: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentRequest>;
|
|
30
|
-
export declare const documentRequestsTemplate: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentRequestsTemplate>;
|
|
31
|
-
export declare const documentTypeProperty: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentTypeProperty>;
|
|
32
|
-
export declare const documentType: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof DocumentType>;
|
|
33
|
-
export declare const document: import("../../orm/server/types.js").PgTableFromType<"document_management", typeof Document>;
|