@opra/common 0.31.1 → 0.31.4
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/browser.js +150 -108
- package/cjs/document/data-type/builtin/any.type.js +2 -1
- package/cjs/document/data-type/builtin/approx-date.type.js +21 -0
- package/cjs/document/data-type/builtin/approx-datetime.type.js +24 -0
- package/cjs/document/data-type/builtin/base64.type.js +2 -1
- package/cjs/document/data-type/builtin/bigint.type.js +2 -1
- package/cjs/document/data-type/builtin/boolean.type.js +2 -1
- package/cjs/document/data-type/builtin/date.type.js +6 -11
- package/cjs/document/data-type/builtin/datetime.type.js +21 -0
- package/cjs/document/data-type/builtin/index.js +3 -1
- package/cjs/document/data-type/builtin/integer.type.js +2 -1
- package/cjs/document/data-type/builtin/null.type.js +2 -1
- package/cjs/document/data-type/builtin/number.type.js +2 -1
- package/cjs/document/data-type/builtin/object-id.type.js +2 -1
- package/cjs/document/data-type/builtin/object.type.js +2 -1
- package/cjs/document/data-type/builtin/string.type.js +2 -1
- package/cjs/document/data-type/builtin/time.type.js +7 -4
- package/cjs/document/data-type/builtin/uuid.type.js +2 -1
- package/cjs/document/data-type/complex-type-class.js +2 -0
- package/cjs/document/data-type/data-type.js +2 -1
- package/cjs/document/data-type/field-class.js +7 -5
- package/cjs/document/factory/type-document-factory.js +3 -6
- package/cjs/document/resource/types/operation-result.type.js +2 -1
- package/cjs/document/type-document.js +1 -1
- package/esm/document/data-type/builtin/any.type.js +2 -1
- package/esm/document/data-type/builtin/approx-date.type.js +18 -0
- package/esm/document/data-type/builtin/approx-datetime.type.js +21 -0
- package/esm/document/data-type/builtin/base64.type.js +2 -1
- package/esm/document/data-type/builtin/bigint.type.js +2 -1
- package/esm/document/data-type/builtin/boolean.type.js +2 -1
- package/esm/document/data-type/builtin/date.type.js +6 -11
- package/esm/document/data-type/builtin/datetime.type.js +18 -0
- package/esm/document/data-type/builtin/index.js +3 -1
- package/esm/document/data-type/builtin/integer.type.js +2 -1
- package/esm/document/data-type/builtin/null.type.js +2 -1
- package/esm/document/data-type/builtin/number.type.js +2 -1
- package/esm/document/data-type/builtin/object-id.type.js +2 -1
- package/esm/document/data-type/builtin/object.type.js +2 -1
- package/esm/document/data-type/builtin/string.type.js +2 -1
- package/esm/document/data-type/builtin/time.type.js +8 -5
- package/esm/document/data-type/builtin/uuid.type.js +2 -1
- package/esm/document/data-type/complex-type-class.js +2 -0
- package/esm/document/data-type/data-type.js +2 -1
- package/esm/document/data-type/field-class.js +7 -5
- package/esm/document/factory/type-document-factory.js +4 -7
- package/esm/document/resource/types/operation-result.type.js +2 -1
- package/esm/document/type-document.js +1 -1
- package/package.json +5 -5
- package/types/document/data-type/builtin/approx-date.type.d.ts +2 -0
- package/types/document/data-type/builtin/approx-datetime.type.d.ts +2 -0
- package/types/document/data-type/builtin/datetime.type.d.ts +2 -0
- package/types/document/data-type/builtin/index.d.ts +3 -1
- package/types/document/data-type/complex-type.d.ts +2 -0
- package/types/document/data-type/data-type.d.ts +4 -2
- package/types/document/data-type/field-class.d.ts +2 -1
- package/types/document/data-type/field.d.ts +1 -0
- package/types/schema/data-type/field.interface.d.ts +0 -4
- package/cjs/document/data-type/builtin/timestamp.type.js +0 -17
- package/esm/document/data-type/builtin/timestamp.type.js +0 -14
- package/types/document/data-type/builtin/timestamp.type.d.ts +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from 'ts-gems';
|
|
1
2
|
import * as vg from 'valgen';
|
|
2
3
|
import type { OpraSchema } from '../../schema/index.js';
|
|
3
4
|
import type { ComplexType } from './complex-type.js';
|
|
@@ -8,12 +9,12 @@ export declare class FieldClass {
|
|
|
8
9
|
readonly origin?: ComplexType;
|
|
9
10
|
readonly type: DataType;
|
|
10
11
|
readonly name: string;
|
|
12
|
+
readonly designType?: Type;
|
|
11
13
|
description?: string;
|
|
12
14
|
isArray?: boolean;
|
|
13
15
|
default?: any;
|
|
14
16
|
fixed?: string | number | boolean;
|
|
15
17
|
required?: boolean;
|
|
16
|
-
nullish?: boolean;
|
|
17
18
|
readonly?: boolean;
|
|
18
19
|
writeonly?: boolean;
|
|
19
20
|
exclusive?: boolean;
|
|
@@ -28,6 +28,7 @@ export declare namespace ApiField {
|
|
|
28
28
|
interface InitArguments extends StrictOmit<OpraSchema.Field, 'type'> {
|
|
29
29
|
name: string;
|
|
30
30
|
type: DataType;
|
|
31
|
+
designType?: Type;
|
|
31
32
|
origin?: ComplexType;
|
|
32
33
|
}
|
|
33
34
|
interface DecoratorOptions extends Partial<StrictOmit<OpraSchema.Field, 'isArray' | 'type'>> {
|
|
@@ -25,10 +25,6 @@ export type Field = {
|
|
|
25
25
|
* Defines if field value required in create operation
|
|
26
26
|
*/
|
|
27
27
|
required?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Defines if field value be nullish (undefined, null or empty)
|
|
30
|
-
*/
|
|
31
|
-
nullish?: boolean;
|
|
32
28
|
/**
|
|
33
29
|
* Defines if the field is readonly
|
|
34
30
|
*/
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimestampType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const valgen_1 = require("valgen");
|
|
6
|
-
const simple_type_js_1 = require("../simple-type.js");
|
|
7
|
-
let TimestampType = exports.TimestampType = class TimestampType {
|
|
8
|
-
};
|
|
9
|
-
exports.TimestampType = TimestampType = tslib_1.__decorate([
|
|
10
|
-
(0, simple_type_js_1.SimpleType)({
|
|
11
|
-
description: 'Timestamp, for example, 2021-04-18T09:12:53',
|
|
12
|
-
decoder: (0, valgen_1.isDate)({
|
|
13
|
-
format: ['YYYY-MM-DDTHH:mm:ss', 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD', 'YYYY']
|
|
14
|
-
}),
|
|
15
|
-
encoder: (0, valgen_1.isDateString)({ format: 'YYYY-MM-DDTHH:mm:ss' })
|
|
16
|
-
})
|
|
17
|
-
], TimestampType);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { isDate, isDateString } from 'valgen';
|
|
3
|
-
import { SimpleType } from '../simple-type.js';
|
|
4
|
-
export let TimestampType = class TimestampType {
|
|
5
|
-
};
|
|
6
|
-
TimestampType = __decorate([
|
|
7
|
-
SimpleType({
|
|
8
|
-
description: 'Timestamp, for example, 2021-04-18T09:12:53',
|
|
9
|
-
decoder: isDate({
|
|
10
|
-
format: ['YYYY-MM-DDTHH:mm:ss', 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD', 'YYYY']
|
|
11
|
-
}),
|
|
12
|
-
encoder: isDateString({ format: 'YYYY-MM-DDTHH:mm:ss' })
|
|
13
|
-
})
|
|
14
|
-
], TimestampType);
|