@tstdl/base 0.92.8 → 0.92.9
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 +19 -4
- package/ai/ai.service.js +241 -3
- package/ai/functions.d.ts +5 -0
- package/ai/functions.js +40 -0
- package/ai/types.d.ts +27 -0
- package/ai/types.js +3 -0
- package/orm/schemas/json.d.ts +2 -2
- package/orm/schemas/numeric-date.d.ts +2 -2
- package/orm/schemas/timestamp.d.ts +2 -2
- package/orm/schemas/uuid.d.ts +2 -2
- package/package.json +5 -4
- package/reflection/registry.js +2 -2
- package/reflection/utils.d.ts +1 -3
- package/schema/decorators/index.d.ts +2 -3
- package/schema/decorators/index.js +1 -3
- package/schema/decorators/schema.d.ts +21 -0
- package/schema/decorators/schema.js +36 -0
- package/schema/decorators/types.d.ts +10 -2
- package/schema/decorators/utils.d.ts +7 -2
- package/schema/decorators/utils.js +26 -7
- package/schema/schema.d.ts +2 -2
- package/schema/schemas/any.d.ts +2 -2
- package/schema/schemas/array.d.ts +2 -2
- package/schema/schemas/bigint.d.ts +2 -2
- package/schema/schemas/boolean.d.ts +2 -2
- package/schema/schemas/date.d.ts +2 -2
- package/schema/schemas/defaulted.d.ts +2 -2
- package/schema/schemas/deferred.d.ts +2 -2
- package/schema/schemas/enumeration.d.ts +2 -2
- package/schema/schemas/function.d.ts +20 -6
- package/schema/schemas/function.js +58 -7
- package/schema/schemas/instance.d.ts +2 -2
- package/schema/schemas/literal.d.ts +2 -2
- package/schema/schemas/never.d.ts +1 -1
- package/schema/schemas/nullable.d.ts +2 -2
- package/schema/schemas/nullable.js +2 -2
- package/schema/schemas/number.d.ts +4 -4
- package/schema/schemas/object.d.ts +2 -2
- package/schema/schemas/object.js +7 -18
- package/schema/schemas/one-or-many.d.ts +2 -2
- package/schema/schemas/optional.d.ts +2 -2
- package/schema/schemas/optional.js +2 -2
- package/schema/schemas/readable-stream.d.ts +2 -2
- package/schema/schemas/regexp.d.ts +2 -2
- package/schema/schemas/string.d.ts +2 -2
- package/schema/schemas/symbol.d.ts +2 -2
- package/schema/schemas/uint8-array.d.ts +2 -2
- package/schema/schemas/union.d.ts +2 -2
- package/schema/schemas/unknown.d.ts +2 -2
- package/schema/testable.d.ts +2 -2
- package/schema/testable.js +9 -9
- package/templates/resolvers/jsx.template-resolver.js +2 -2
- package/types.d.ts +1 -1
- package/utils/object/lazy-property.d.ts +2 -2
- package/utils/object/object.d.ts +2 -1
- package/schema/decorators/property.d.ts +0 -12
- package/schema/decorators/property.js +0 -21
|
@@ -8,14 +8,14 @@ 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
10
|
import { Singleton } from '../../injector/decorators.js';
|
|
11
|
-
import {
|
|
11
|
+
import { Method } from '../../schema/index.js';
|
|
12
12
|
import { TemplateField, simpleTemplate } from '../template.model.js';
|
|
13
13
|
import { TemplateResolver } from '../template.resolver.js';
|
|
14
14
|
export class JsxTemplateField extends TemplateField {
|
|
15
15
|
template;
|
|
16
16
|
}
|
|
17
17
|
__decorate([
|
|
18
|
-
|
|
18
|
+
Method(null, null),
|
|
19
19
|
__metadata("design:type", Object)
|
|
20
20
|
], JsxTemplateField.prototype, "template", void 0);
|
|
21
21
|
let JsxTemplateResolver = class JsxTemplateResolver extends TemplateResolver {
|
package/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Observable } from 'rxjs';
|
|
|
2
2
|
import type { CamelCase, Except, IsEqual, LiteralUnion, Tagged, UnwrapTagged } from 'type-fest';
|
|
3
3
|
import type { Signal } from './signals/api.js';
|
|
4
4
|
export type ObjectLiteral = {};
|
|
5
|
+
export type Function<P extends any[] = any[], R = any> = (...params: P) => R;
|
|
5
6
|
export type PrimitiveTypeMap = {
|
|
6
7
|
string: string;
|
|
7
8
|
number: number;
|
|
@@ -214,5 +215,4 @@ export type Untagged<T> = T extends Tagged<unknown, any, any> ? UnwrapTagged<T>
|
|
|
214
215
|
export type UntaggedDeep<T> = T extends Tagged<unknown, any, any> ? UnwrapTagged<T> : T extends readonly (infer U)[] ? UntaggedDeep<U>[] : T extends Record ? {
|
|
215
216
|
[P in keyof T]: UntaggedDeep<T[P]>;
|
|
216
217
|
} : Untagged<T>;
|
|
217
|
-
export type AnyFunction = Function;
|
|
218
218
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Function, IfUnknown } from '../../types.js';
|
|
2
2
|
declare const lazyObjectValueSymbol: unique symbol;
|
|
3
3
|
export type LazyPropertyInitializer<T, K extends keyof T> = (this: T, key: K) => T[K];
|
|
4
4
|
export type LazyPropertyObjectDefinition<T extends object, P extends keyof T> = LazyPropertyDescriptor & {
|
|
@@ -15,7 +15,7 @@ export type LazyObjectValue<T> = {
|
|
|
15
15
|
[lazyObjectValueSymbol]: typeof lazyObjectValueSymbol;
|
|
16
16
|
value: T;
|
|
17
17
|
};
|
|
18
|
-
export type LazyInitializerItem<T extends object, P extends keyof T> = Exclude<IfUnknown<T[P], never, T[P]>,
|
|
18
|
+
export type LazyInitializerItem<T extends object, P extends keyof T> = Exclude<IfUnknown<T[P], never, T[P]>, Function | object> | LazyPropertyInitializer<T, P> | LazyPropertyObjectDefinition<T, P> | LazyObjectValue<T[P]>;
|
|
19
19
|
export type LazyPropertyDescriptor = {
|
|
20
20
|
/**
|
|
21
21
|
* True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object
|
package/utils/object/object.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type JsonPathInput } from '../../json-path/json-path.js';
|
|
2
|
-
import type { BaseType, FromEntries, ObjectLiteral, Optionalize, PickBy, Record, SimplifyObject } from '../../types.js';
|
|
2
|
+
import type { BaseType, FromEntries, ObjectLiteral, Optionalize, PickBy, Record, SimplifyObject, UnionToIntersection } from '../../types.js';
|
|
3
|
+
export declare function hasOwnProperty<T extends Record, K extends keyof UnionToIntersection<T>>(obj: T, key: K): obj is Extract<T, Partial<Record<K>>>;
|
|
3
4
|
export declare function hasOwnProperty<T extends Record>(obj: T, key: keyof T): boolean;
|
|
4
5
|
/**
|
|
5
6
|
* Returns object entries including those with symbols keys (which Object.entries does not)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SetRequired } from 'type-fest';
|
|
2
|
-
import type { Decorator } from '../../reflection/index.js';
|
|
3
|
-
import type { TypedOmit } from '../../types.js';
|
|
4
|
-
import type { SchemaTestable } from '../schema.js';
|
|
5
|
-
import type { SchemaPropertyReflectionData, SchemaTestableProvider } from './types.js';
|
|
6
|
-
export type SchemaPropertyDecoratorOptions = SchemaPropertyReflectionData;
|
|
7
|
-
export type SchemaPropertyDecoratorOptionsWithRequiredSchema = SetRequired<SchemaPropertyReflectionData, 'schema'>;
|
|
8
|
-
export type SchemaPropertyDecoratorOptionsWithoutSchema = TypedOmit<SchemaPropertyReflectionData, 'schema'>;
|
|
9
|
-
export declare function Property(schema: SchemaTestable, options?: SchemaPropertyDecoratorOptionsWithoutSchema): Decorator<'property' | 'accessor'>;
|
|
10
|
-
export declare function Property(options: SchemaPropertyDecoratorOptionsWithRequiredSchema): Decorator<'property' | 'accessor'>;
|
|
11
|
-
export declare function PropertySchema(schemaProvider: SchemaTestableProvider, options?: SchemaPropertyDecoratorOptionsWithoutSchema): Decorator<'property' | 'accessor'>;
|
|
12
|
-
export declare function PropertySchema(options: SchemaPropertyDecoratorOptionsWithRequiredSchema): Decorator<'property' | 'accessor'>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import { isDefined, isFunction } from '../../utils/type-guards.js';
|
|
3
|
-
import { createSchemaPropertyDecorator } from './utils.js';
|
|
4
|
-
export function Property(schemaOrOptions, optionsOrNothing) {
|
|
5
|
-
if (isDefined(optionsOrNothing)) {
|
|
6
|
-
return createSchemaPropertyDecorator({ ...optionsOrNothing, schema: () => schemaOrOptions });
|
|
7
|
-
}
|
|
8
|
-
if (isFunction(schemaOrOptions)) {
|
|
9
|
-
return createSchemaPropertyDecorator({ schema: () => schemaOrOptions });
|
|
10
|
-
}
|
|
11
|
-
return createSchemaPropertyDecorator(schemaOrOptions);
|
|
12
|
-
}
|
|
13
|
-
export function PropertySchema(schemaProviderOrOptions, optionsOrNothing) {
|
|
14
|
-
if (isDefined(optionsOrNothing)) {
|
|
15
|
-
return createSchemaPropertyDecorator({ ...optionsOrNothing, schema: schemaProviderOrOptions });
|
|
16
|
-
}
|
|
17
|
-
if (isFunction(schemaProviderOrOptions)) {
|
|
18
|
-
return createSchemaPropertyDecorator({ schema: schemaProviderOrOptions });
|
|
19
|
-
}
|
|
20
|
-
return createSchemaPropertyDecorator(schemaProviderOrOptions);
|
|
21
|
-
}
|