@nocobase/database 1.7.0-beta.18 → 1.7.0-beta.19
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/lib/interfaces/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __reExport(interfaces_exports, require("./datetime-interface"), module.exports);
|
|
|
31
31
|
__reExport(interfaces_exports, require("./datetime-no-tz-interface"), module.exports);
|
|
32
32
|
__reExport(interfaces_exports, require("./boolean-interface"), module.exports);
|
|
33
33
|
__reExport(interfaces_exports, require("./date-interface"), module.exports);
|
|
34
|
+
__reExport(interfaces_exports, require("./time-interface"), module.exports);
|
|
34
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
36
|
0 && (module.exports = {
|
|
36
37
|
...require("./base-interface"),
|
|
@@ -40,5 +41,6 @@ __reExport(interfaces_exports, require("./date-interface"), module.exports);
|
|
|
40
41
|
...require("./datetime-interface"),
|
|
41
42
|
...require("./datetime-no-tz-interface"),
|
|
42
43
|
...require("./boolean-interface"),
|
|
43
|
-
...require("./date-interface")
|
|
44
|
+
...require("./date-interface"),
|
|
45
|
+
...require("./time-interface")
|
|
44
46
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { BaseInterface } from './base-interface';
|
|
10
|
+
export declare class TimeInterface extends BaseInterface {
|
|
11
|
+
toValue(value: any, ctx?: any): any;
|
|
12
|
+
validate(value: any): boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var time_interface_exports = {};
|
|
39
|
+
__export(time_interface_exports, {
|
|
40
|
+
TimeInterface: () => TimeInterface
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(time_interface_exports);
|
|
43
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
44
|
+
var import_utc = __toESM(require("dayjs/plugin/utc"));
|
|
45
|
+
var import_base_interface = require("./base-interface");
|
|
46
|
+
import_dayjs.default.extend(import_utc.default);
|
|
47
|
+
const _TimeInterface = class _TimeInterface extends import_base_interface.BaseInterface {
|
|
48
|
+
toValue(value, ctx) {
|
|
49
|
+
if (this.validate(value)) {
|
|
50
|
+
const result = import_dayjs.default.utc(value).format("HH:mm:ss");
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
validate(value) {
|
|
56
|
+
const result = (0, import_dayjs.default)(value).isValid();
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
__name(_TimeInterface, "TimeInterface");
|
|
61
|
+
let TimeInterface = _TimeInterface;
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
TimeInterface
|
|
65
|
+
});
|
package/lib/interfaces/utils.js
CHANGED
|
@@ -62,7 +62,8 @@ const interfaces = {
|
|
|
62
62
|
obo: import_one_belongs_to_one_interface.OneBelongsToOneInterface,
|
|
63
63
|
o2m: import_one_to_many_interface.OneToManyInterface,
|
|
64
64
|
m2o: import_many_to_one_interface.ManyToOneInterface,
|
|
65
|
-
m2m: import_many_to_many_interface.ManyToManyInterface
|
|
65
|
+
m2m: import_many_to_many_interface.ManyToManyInterface,
|
|
66
|
+
time: import_index.TimeInterface
|
|
66
67
|
};
|
|
67
68
|
function registerInterfaces(db) {
|
|
68
69
|
for (const [interfaceName, type] of Object.entries(interfaces)) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "1.7.0-beta.
|
|
10
|
-
"@nocobase/utils": "1.7.0-beta.
|
|
9
|
+
"@nocobase/logger": "1.7.0-beta.19",
|
|
10
|
+
"@nocobase/utils": "1.7.0-beta.19",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
39
39
|
"directory": "packages/database"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1b828a2402d699654010f5b9fa3c706ee7f1539a"
|
|
42
42
|
}
|